J F W

making web application programming easier is possible

HOW TO : CORE

create a pdf file

To create a pdf file the iText library is used. In particular, a special method of this library is used that permits us to set the values of objects that have been set in a pdf file. So, if you have a pdf file with objects you can set the values like this:

When you create an instance of class Pdf2Pdf you pass as parameters the pdf file to use as template and an HashMap with the data. The keys used in the HashMap must be the same as the names of the objects set in the pdf template.

If you want to save the new pdf file (byte[] pdfContent) on disk you can use the class SaveFile (see manage normal and zipped files).