I have an application which generates PDFs. Now I’m using Apache FOP just for generate a document from scratch (XML+XSLT). The question is there some kind of library/method that I can treat my source PDF document as a template?
I mean, I create a document with Adobe Acrobat and just set there some markups like ${Name}, ${Surname}, ${Address} and then I put it into the library providing values for Name, Surname and Address.
Hope you can understand me.
Regards.
PDFBox, iText and PDFlib are PDF libraries that allow you to modify existing PDF files instead of only generating them like FOP does. This would allow you to load the template document and replace the placeholders with the actual values.
http://pdfbox.apache.org/
http://itextpdf.com/
http://www.pdflib.com/
PDFBox also provides sample code on how to replace a string in the document with another value: https://pdfbox.apache.org/apidocs/org/apache/pdfbox/examples/pdmodel/ReplaceString.html