pdf-generation

Best way to create/fill-in printed forms and pdfs?

▼魔方 西西 提交于 2019-12-03 07:26:20
问题 We have a C# application that must print complex forms. Things like multi-page government compliance forms that must be in a specific format. We can get PDF copies of these forms and create form fields, but aren't sure how to fill in this data and create a PDF that can be auto-printed and sent to our clients (they need paper copies). Also, some of the forms are dynamic, in that certain pages must be repeated (for example, for an employee equal opportunity audit report we might need to include

Adding an image to a pdf with pdftk

无人久伴 提交于 2019-12-03 07:25:17
问题 Hello I am using pdftk to generate a PDF based on a form that is submitted. I have everything working fine until here. Which is adding an image of a signature. I am using signature pad which works great to generate the image file of the signature. Now i am trying to add that signature image to the PDF? Does anyone know if this is even possible to do with pdftk? i don't see the option to do that. Or if its even possible to attach to the image to a form filed that i have in the PDF? 回答1: First

How do I insert a background image on all pages of a pdf-document? [closed]

淺唱寂寞╮ 提交于 2019-12-03 06:58:53
I need sample code in C# to insert the background image on all pages of the finished pdf-document. I'm using iTextSharp library. Soner Gönül You can try this; void makePDF() { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=test.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); string imageFilePath = Server.MapPath(".") + "/images/test.jpg"; iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(imageFilePath); // Page site and margin left, right, top, bottom is defined Document pdfDoc = new Document(PageSize.A4,

TCPDF set different headers for different pages in one document

会有一股神秘感。 提交于 2019-12-03 06:16:48
Is there a way to have a different header logo for the 1st page in a document and different for the 2nd page? I thought that changing the header data between adding pages might do the trick, but in my tests it seems that setting the header after adding the first page has no effect: /* other stuff $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf-

How to add an image to asciidoc book cover page?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 05:59:24
I would like to create a pdf book using asciidoc. The title page should include the title, subtitle and an image. So far I could not find any documentation on how to achive this. Intuivly I would do something like My book title ============= :author: myself :toc: image:images/titelimage.png[width=400] but this just adds image:images/titelimage.png[width=400] as a subtitle. What I would like to have is something like My book title <titleimage> subtitle Is there a way to do this in ascciidoc? If not, what do I need to do to get this? If you're using asciidoctor-pdf you can define an attribute

Create new PDF from template with PHP

孤街醉人 提交于 2019-12-03 05:49:38
问题 I have a docx document file set up with formating and layout, which I saved as a PDF file. I want to use this pdf file as a template for creating new pdf files pre-filled with user data. I have seen FPDF, FPDI, tcPDF, domPDF, Zend PDF, http://koivi.com/fill-pdf-form-fields/ (Justin Koivisto), a few convertion tools like HTML2PDF and a few command line tools mentioned here on stackoverflow. With the exception of FPDI, none of them offer an example using a PDF template to either search-and

Is there any direct way to generate pdf from markdown file by python [closed]

会有一股神秘感。 提交于 2019-12-03 05:40:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago . As the title, I want to use markdown as my main write format and I need to generate PDF files from markdown using pure python. 回答1: I have done and would do it in two steps. First, I'd use python-markdown to make HTML out of my Markdown, and then I'd use xhtml2pdf to make a PDF

Splitting a PDF with Ghostscript

依然范特西╮ 提交于 2019-12-03 04:23:59
I try to split a multipage PDF with Ghostscript, and I found the same solution on more sites and even on ghostscript.com , namely: gs -sDEVICE=pdfwrite -dSAFER -o outname.%d.pdf input.pdf But it seems not working for me, because it produces one file, with all pages, and with the name outname.1.pdf . When I add the start and end pages, then it is working fine, but I want it to work without knowing those parameters. In the gs-devel archive, I found a solution for this: http://ghostscript.com/pipermail/gs-devel/2009-April/008310.html -- but I feel like doing it without pdf_info . When I use a

How to render a complex UIView into a PDF Context with high resolution?

与世无争的帅哥 提交于 2019-12-03 03:48:27
There are several questions on SO asking how to render a UIView into a PDF context, but they all use view.layer.renderInContext(pdfContext), which results in a 72 DPI image (and one that looks terrible when printed). What I'm looking for is a technique to somehow get the UIView to render at something like 300 DPI. In the end, I was able to take hints from several prior posts and put together a solution. I'm posting this since it took me a long time to get working, and I really hope to save someone else time and effort doing the same. This solution uses two basic techniques: Render the UIView

Generate pdf files phantomjs, repeating HEADER

ⅰ亾dé卋堺 提交于 2019-12-03 03:36:36
I'm generating pdf files using phantomjs but I would like to repeat a defined header with HTML, it works when there are no images but as soon I add it doesn't work page.viewportSize = { width: 600, height: 600 }; page.paperSize = { format: 'A4', orientation: 'portrait', margin: '0px', header: { height: "1.2cm", contents: phantom.callback(function(pageNum, numPages) { return '<img src="https://www.google.com.bo/images/srpr/logo4w.png" height="0.95cm"/>'; }) }, footer: { height: "0.7cm", contents: phantom.callback(function(pageNum, numPages) { return '<h3 class="header">Footer</h>'; }) } } Hacky