Reputation: 146
In Java Project, i would like to use a Freemarker or something similar to it (Quick start guide), but to generate a PDF file (textual), with IText for example.
Of cource, the workflow could be like that:
Template (Freemarker) -> Text (IText) -> PDF
...but I feel it is kind of a naive approach. I want to have in the PDF some formattings, tables, etc.
Anyone knows how to design it properly?
Upvotes: 0
Views: 4504
Reputation: 109593
As PDF is a binary format, the best seems to generate some standard text format for which there exists a PDF conversion.
Texts --[FreeMarker]--> HTML or --[HTML-to-iText]--> PDF
DocBook XML
This also allows validation of the FreeMarker templates.
Upvotes: 1