The question is too broad, so I can give you a very broad answer.
Option 1: you create your layout using high-level iText objects. There are many applications that use PdfPTable to create complex reports. For example: temporary tables for a German railway company are created from scratch through a code; The invoices for the Belgian company Telco are created in this way ... The advantage of this approach is that you can fine-tune the layout. The downside is that you need to change the source code as soon as you want to change the layout.
Option 2: you create your layout by creating an AcroForm template. Each field in this template has a name and is visualized in the exact position (determined by its coordinates) on certain pages. The code to fill out this form consists of several lines. Whenever you need to change the layout, you change the AcroForm template. You do not need to change your code. The downside is that AcroForms are very static. Compare this to a paper form: you cannot insert a string into a paper form.
Option 3: you create your data in XHTML format and styles in CSS. The Belgian printing company responsible for creating invoices for its customers, streams data into very simple HTML files containing sequences of tables that never span more than a few pages. These files are then transferred to the iText XML working file along with CSS, which is different for each of its clients. The advantage of this approach is that additional programming is not required when connecting a new client. It's just a matter of creating new CSS. The downside is that you are limited to the HTML format. Elementary logic also tells you that you should not expect URL2PDF: have you ever tried to print a website? Well, the poor quality of this print should indicate problems you will encounter when trying to convert HTML to PDF. If you expect them, you can get good results. If you do not ... this is a bad master who blames his tools ...
Option 4: Define your template using the XML Forms architecture. Such templates are usually created using Adobe LiveCycle Designer. XSD is submitted to LC Designer, and the result is a blank form in which the PDF format acts as a container for the XML stream. You can then use iText to insert your own XML data that corresponds to the XSD in the PDF, and you can use the XFA Worker to smooth this shape. An XFA employee is only available as a closed source product (divers should set limits because they rarely do).
Option 5:. XML Worker is used to convert XHTML + CSS and XFA to PDF (regular PDF, PDF / A, PDF / UA). You can use the generic XML Worker engine to support your own XML format. An advantage would be a very powerful engine that you can customize to meet your specific needs. The disadvantage is that this is due to serious upfront investments in development.
Option 6: use a third-party tool to determine the template and a third-party server that uses iText under the hood to create PDF files based on the template. An example of such a third-party tool is Scriptura, developed by Inventive Designers. There are other tools, but Inventive Designers is an iText client, and we know that they use iText correctly, while we do not have this guarantee from other suppliers.
source share