How to fill out a pdf file programatically? [closed]

To elaborate on the answer by duffymo you’ve approved, allow me to share a chapter of my book with you: manning.com/lowagie2/samplechapter6.pdf

In section 6.3.5, you’ll find out how to create a PDF template using Open Office, and listing 6.19 will show you how to fill it out programmatically:

PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
AcroFields form = stamper.getAcroFields();
form.setField(key, value);
stamper.setFormFlattening(true);
stamper.close();
reader.close();

Just like Frank Rem, I need to add that I’m the original developer of iText, the author of the books about iText, and the current CEO of the iText Group, answering this mail straight from the ISO committee that is discussing ISO-32000-2 (aka PDF 2.0) 😉

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)