If it is a PDF form you are referring to, then you can try one of the two methods below:
Method 1:
- Using overlay’s
- Create a document that fits the text fields on your existing document
- Fill the values in the text fields on your created document
- Using OverlayPdfDocument in community commons, you can keep your existing PDF on the background and overlay the values on top of the existing form.
- IMHO, this is more maintainable
Method 2:
- Write a Java class, which can put some text on the PDF on a given location
- You can use PDPageContentStream for the same