Java – Using XFDF for pdf

javapdf-generation

Does anyone have experience using XFDF for pdf's? Are there any pitfalls in using this approach?

Step1 – I would need to create a pdf (adobe pro) with read only fields that are bound to elements in XML. This would act as a stencil to overly the data.

Step2 – Create custom classes that generate the XFDF XML string from data in our database.

Step3 – When a user requests a pdf, we simply would retrieve the data from the DB, construct the XFDF string and flush the string to the browser.

The main benefit to this architectural decision is that there is no need to store pdf's in the db or on hard drive. Additionally, I have seen many pdf generation implementations that use home grown batch processes that are buggy and only create another 'moving part' in an application.

Best Answer

I've been using XFDF for my projects and the technology proved to be reliable and sustainable. Firstly because it is XML, I could compress the XML and store them persistently with low foot-print. As Mark Storer has explained above, there are limitations that XFDF could not do that is support script. Should you require a library that does the XFDF/FDF field merge, you might give [nguyen][https://github.com/joneslee85/nguyen] gem a try.