pdf-generation

wkhtmltopdf automatic page breaks

烈酒焚心 提交于 2019-12-07 01:03:19
问题 I'm using wkhtmltopdf v0.11.0 rc1 in a Rails application through wicked_pdf (I know wicked_pdf does not support the new command line parameter notation, I'm using my own fork of the gem). I thought that content not fitting within a page should automatically overflow to the next one, but this is not the case - I'm seeing text just being cut off, sometimes in the middle of a line. I know I can layout my pages using page-break-after:always , but this looks like dirty hard-coding, and besides the

How do I walk through tree of Pdf Objects in PDFSharp?

半腔热情 提交于 2019-12-07 00:57:29
问题 I am trying to to walk though the tree of PdfItem objects in an existing PDF document using PDFSharp in c#. I want to create a hierarchy of all the objects as I go along -- similar to what the "PDF Explorer" example does -- but I want it to be a tree instead of a flat list of all the objects. The root node is document.Internals.Catalog. And I want to to walk down through all the document.Internals.Catalog.Elements until I have visited every element. One of the problems I run into is that

How to write UTF-8 characters to a pdf file using itextsharp?

萝らか妹 提交于 2019-12-06 17:19:53
问题 I have tried a lot on google but not able to find.. Any help is appreciated. Please find the code below:- protected void Page_Load(object sender, EventArgs e) { StreamReader read = new StreamReader(@"D:\queryUnicode.txt", Encoding.Unicode); string str = read.ReadToEnd(); Paragraph para = new Paragraph(str); FileStream file = new FileStream(@"D:\Query.pdf",FileMode.Create); Document pdfDoc = new Document(); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, file ); pdfDoc.Open(); pdfDoc.Add(para

How to add fonts using tFPDF

核能气质少年 提交于 2019-12-06 16:42:12
I try to create pdf file using tFPDF with custom font. I put arial font inside font/unifont folder. I use this code to create pdf file: $pdf->AddFont('arialbd','','arialbd.ttf',true); $pdf->SetFont('arialbd','',16); $pdf->Cell(40,6, 'OÜ Kersti Võlu Koolituskeskus', 0, 1); $pdf->SetFont('arialbd','',10); $pdf->Cell(40,12,'REGISTREERIMISLEHT', 0, 1); $pdf->Output('test.pdf', 'I'); It works well on localhost, but when I uploaded this file on server, it shows me an error: Warning: fopen(C:\xampp\htdocs\koolitus\wp-content\plugins\koolitus\fpdf/font/unifont/arialbd.ttf) I see that library tries to

Issues in generating PDF from uiwebview in objective c

我怕爱的太早我们不能终老 提交于 2019-12-06 16:08:51
问题 I have open pdf file in uiwebview, add image and text in uiwebview subview.Then i tried created pdf file. Below sample i have used to generate pdf file. Multiple page writing in single page. How can i write sample quality and exact size. Please check screen shots and below source UIGraphicsBeginPDFContextToData( pdfData, CGRectZero, nil ); for (int i = 0; i < 10; i++) { CGRect f = [pdfView frame]; [pdfView setFrame: f]; UIGraphicsBeginPDFPage(); CGContextRef currentContext =

Convert a image url to pdf using jspdf

限于喜欢 提交于 2019-12-06 15:26:01
function convertImgToBase64(url) { var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); img = document.createElement('img'), img.src = url; canvas.height = img.height; canvas.width = img.width; var dataURL = canvas.toDataURL('image/jpeg') alert(dataURL); canvas = null; return dataURL; } var imageurl = 'http://qph.is.quoracdn.net/main-qimg-ca033a73e2ea858908c44905d4c25f4b?convert_to_webp=true'; var som =convertImgToBase64(imageurl); doc.addImage(som, 'JPEG', 15, 40, 180, 180); doc.output('datauristring'); but nothing happens no pdf is generated ? I am getting the

Align Page Number to Right Corner in MigraDoc

安稳与你 提交于 2019-12-06 14:49:53
I know how to show page numbers and how to align them in footer. However my problem is that my Footer contains some custom text which should be left aligned and page number should be aligned to right corner. string footer = "My custom footer"; Paragraph footerParagraph = section.Footers.Primary.AddParagraph(footer); footerParagraph.AddTab(); footerParagraph.AddPageField(); Above will generate "My custom footer 1" for page 1, I need page nmuber to be right at the right most corner of the page. I can add extra spaces or tab but thought there must be a clean way to achieve this. Thanks. Keep it

Export or Download d3.js sunburst / collapsible tree charts as pdf file

不羁岁月 提交于 2019-12-06 14:12:31
I need to download my d3.js collapsible tree chart and sunburst chart as PDF file . I tried using jspdf.plugin.svgToPdf plugin but it doesnt work. Could someone guide me in downloading the charts as pdf ? My source code for collapsible tree (function () { var out$ = typeof exports != 'undefined' && exports || this; var margin = { top : 20, right : 120, bottom : 20, left : 120 }, width = 960 - margin.right - margin.left, height = 800 - margin.top - margin.bottom; var i = 0, duration = 750, root; var tree = d3.layout.tree() .size([height, width]); var diagonal = d3.svg.diagonal() .projection

Howto open a link in a pdf-file in a new window?

我只是一个虾纸丫 提交于 2019-12-06 13:40:22
问题 I have a link in a pdf-document (PDF1), which is embedded in a browser instance. Or let's say the Adobe Reader is embedded in a browser window. In this pdf-document (PDF2) is a link to a servlet, which view opens another pdf-file. Now the new pdf-document is opened in a embedded Adobe Reader in the same browser window. How can this document (PDF2) be opened in a new browser window with a new embedded Adobe Reader? Does this depend on the editor tool used for the generation of the pdf-document

Uploading a PDF file to Google Docs generated by pdfjet on GAE/J

回眸只為那壹抹淺笑 提交于 2019-12-06 13:34:06
I need to upload a PDF file to users google docs which is generated by pdfjet on google app engine. I figure out to generate pdf using pdfjet for gae/j. pdfjet uses streams to create the pdf. Is there anyway to convert stream to file so I can upload to users google docs. I tried gaevfs but couldn't make it work. I can use another pdf generation solution if needed or another virtual file system etc. PDF generation code ByteArrayOutputStream os = new ByteArrayOutputStream(); PDF pdf = new PDF(os); Google Docs API code DocumentListEntry newEntry = new PdfEntry(); newEntry.setTitle(new