Dynamic Data in Template

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for Java (v8)  /  Dynamic Data in Template

DynamicPDF Generator for Java (v8) Forum

 Apr 07 2016 5:33 PM
Is it possible to have a template that has static data as well as room for dynamic data without having to construct the entire thing from code?

Essentially the template would have basic fields that would get filled in (i.e. similar to merge fields in Word) as well as tables with a dynamic amount of rows.

I didn't see any examples included that made me think this was possible without building the PDF all within code or having to reserve a known amount of space for dynamic fields and tables.
 Apr 08 2016 3:57 PM
Posted by a ceTe Software moderator
Hello,

Yes, it is possible to open and fill an existing PDF template with data using DynamicPDF Merger for Java and it includes DynamicPDF Generator.

If you have a PDF template that has acro form fields then you can use our API to access the form field collection and update the form field values. This is demonstrated in the AcroForm Filler Example. In case the PDF template do not have acro form fields but has empty space or place holders, then you will need to know the exact coordinates of that place holder beforehand to be able to place a text at that location. This demonstrated in the Form Filler Example. Source code and PDF templates used for these two examples are provided in the product’s evaluation download.

If you need to add dynamically expanding data in between static content on an existing PDF template, then you will have to leave enough space beforehand to accommodate the dynamic data. If you design the PDF template in such a way that the dynamic data ends up on new page, then you can dynamically create as many new pages as you need with dynamic data and insert or append them to the PDF template. Here are the links that discuss how to dynamically generate pages with text and tables.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 12:03 PM.