pdf-generation

Add image in an existing PDF with itextsharp

孤者浪人 提交于 2019-12-11 10:36:33
问题 SO i have a created a PDF template form with textbox which are editable fields. I am able to generate the pre-populated PDF with values from my database into the template through MVC 4.0 Application. Which works fine. Now i want to add a image from a folder into the PDF which will distinguished one form with another form. The image will depend on the user in-put. Image will go at the bottom of the PDF. I don't see any image-box or image container as a filed option. Only one i can see are text

Smiley emoticon showed as weird character in PDF made with wkhtmltopdf

℡╲_俬逩灬. 提交于 2019-12-11 10:34:26
问题 I'm trying to convert the following HTML to a PDF using wkhtmltopdf , version 0.12.2.1 (with patched qt) : <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title of the document</title> </head> <body> 😋 </body> </html> The HTML contains the hex character 😋 which shows up fine in the HTML as an emoticon, but in my PDF it looks like this: Why is it displayed like that and how can I fix this? The command I'm using is: wkhtmltopdf /tmp/test.html /tmp/foo.pdf 回答1: For someone

Cannot display background color when using rowspan with itext pdf

孤街浪徒 提交于 2019-12-11 10:15:59
问题 I am trying to create a table like the one shown here: I want to use a rowspan of 2. The problem is that when I use rowspan, the background color of the top row shows fine but the 2nd row shows white. I am facing the same issue shown here: http://itext.2136553.n4.nabble.com/Rowspan-and-background-color-td4659361.html I am trying to do this in Java. Am I missing something silly here ? 回答1: Please take a look at the SimpleTable10 example. In this example, I tried to reproduce your problem by

jsPDF create PDF from .html and open in new window

时光总嘲笑我的痴心妄想 提交于 2019-12-11 10:15:00
问题 I am trying to use jsPDF to convert a .html file to PDF and open it in a new window. I am gnerating de PDF like this: function PDFFromHTML() { var doc = new jsPDF(); // We'll make our own renderer to skip this editor var specialElementHandlers = { '#editor': function(element, renderer){ return true; } }; // All units are in the set measurement for the document // This can be changed to "pt" (points), "mm" (Default), "cm", "in" doc.fromHTML('ticket.html', 15, 15, { 'width': 170,

What's wrong with my pdf writer?

落花浮王杯 提交于 2019-12-11 09:46:55
问题 I'm writing code to produce pdfs (from postscript of course), and I've tried to follow the spec as best I could. But imagemagick's identify says there's something wrong with my xref table. Can anyone see where/what my problem is? $ echo quit | gsnd -q pw.ps dancingmen.ps | identify - **** Warning: An error occurred while reading an XREF table. **** The file has been damaged. This may have been caused **** by a problem while converting or transfering the file. **** Ghostscript will attempt to

Separating Page Breaks with DinkToPdf

萝らか妹 提交于 2019-12-11 09:02:40
问题 I have this C# in my Program.cs: var page = "plain"; var slnpath = $@"{Directory.GetCurrentDirectory()}\..\..\..\.."; var htmlpath = $@"{slnpath}\HtmlTemplates\{page}.html"; var pdfpath = $@"{slnpath}\PdfFiles\{page}.pdf"; var dllpath = $@"{slnpath}\DinkNative64bit\libwkhtmltox.dll"; var html = new StringBuilder(File.ReadAllText(htmlpath)); var _converter = new SynchronizedConverter(new PdfTools()); var context = new CustomAssemblyLoadContext().LoadUnmanagedLibrary(dllpath); var

IText 2 + Flying Saucer: how to avoid that the images appears broken between two pdf's pages?

痴心易碎 提交于 2019-12-11 08:47:20
问题 i have an html file and i'm using Itext 2 with flying Saucer to convert it to a pdf file. The problem is that if an image starts near the page end, flying saucer render a portion of it it the end of the current page and the rest in the beginning of the next page. How to say that i want the entire image on one page only? 回答1: You can add this to your print css: img { page-break-inside: avoid; } The user guide (PDF) mentions it. 回答2: There appears to be a bug in FlyingSaucer that is causing

Error signing pdf with PHP's openssl_pkcs7_sign

大城市里の小女人 提交于 2019-12-11 08:32:16
问题 I am using TCPDF to generate a pdf document and sign it. TCPDF itself just calls PHP's openssl_pkcs7_sign function, which seems to me to be calling C's PKCS7_sign function based on source code. Until recently things were working fine. Then I changed certificate provider. I just updated the private key, the certificate, and the certificate chain : $pdf->setSignature( $this->public_certificate_path, $this->private_key_path, $this->private_key_password, $this->extra_certificates_path, 1); I

iText Pdf Header Removal for particular page

风格不统一 提交于 2019-12-11 08:14:47
问题 I'm generating a PDF with iText, in that I'm displaying a header and footer. Now i want to remove header for a particular page. For eg: If I'm generating a 50 pages pdf, for the final 50th I don't want to show header, how could this be achieved? Here's my code where I'm generating footer (header part removed). public class HeaderAndFooter extends PdfPageEventHelper { public void onEndPage (PdfWriter writer, Document document) { Rectangle rect = writer.getBoxSize("art"); switch(writer

iTextSharp multiple actions for pushbuttonfield

做~自己de王妃 提交于 2019-12-11 08:04:56
问题 In a PDF, I can set up a button to Submit the FDF data to my RestAPI Redirect to a webpage (to tell user 'Thanks') and that works perfectly. But I need to do this using code... I am using iTextSharp in the following way: pb is my pushbutton... sURL is the URL I need the data to go to... This is my code: PdfFormField pff = pb.Field; pff.SetAdditionalActions(PdfName.A, PdfAction.CreateSubmitForm(sURL, null, PdfAction.SUBMIT_XFDF)); af.ReplacePushbuttonField("submit", pff); This does replace the