acrofields

Add image to acrofield in iText?

情到浓时终转凉″ 提交于 2019-11-28 08:37:38
I'm trying to fill PDF using acrofields, I'm able to add string data perfectly, but having issues in adding images to acrofields. This is my code for adding string data.. File f = new File("F:/Test/Agreement.pdf"); InputStream sourceTemplatePDFUrlStream = new BufferedInputStream(new FileInputStream(f)); File destinationFile = new File("F:/Test/ag1.pdf"); PdfReader reader = new PdfReader(sourceTemplatePDFUrlStream); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream( destinationFile)); AcroFields form = stamper.getAcroFields(); Image img = Image.getInstance("E:/signature/signature

AcroForm values missing after flattening

自作多情 提交于 2019-11-28 02:07:22
I'm using LibreOffice 4.1.3.2 to produce a fillable PDF: Created a Writer document Set some text and test fields Exported to PDF Opening pdf file with Acrobar Reader shows a correct fillable pdf. Next I use iTextSharp 5.4.5 to fill fields and save flattened document: var pdf = new PdfReader(srcFilename); using (var fw = new FileStream(dstFilename, FileMode.Create)) { var stamper = new PdfStamper(pdf, fw); var f = stamper.AcroFields; f.SetField("field1", "John Doe"); f.SetField("field2", "12/04/2013"); stamper.FormFlattening = true; stamper.Close(); } pdf.Close(); Problem is that filled fields

Add image to acrofield in iText?

浪子不回头ぞ 提交于 2019-11-27 02:20:32
问题 I'm trying to fill PDF using acrofields, I'm able to add string data perfectly, but having issues in adding images to acrofields. This is my code for adding string data.. File f = new File("F:/Test/Agreement.pdf"); InputStream sourceTemplatePDFUrlStream = new BufferedInputStream(new FileInputStream(f)); File destinationFile = new File("F:/Test/ag1.pdf"); PdfReader reader = new PdfReader(sourceTemplatePDFUrlStream); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(