We’ve just released version 1.4 of iText DITO, our high-convenience PDF document generator. This new release includes several great new features, such as a wizard for barcode generation, conditional formatting of alphanumeric data bindings, formatting preservation for HTML tags embedded in JSON payloads, and PDF password protection. Read on to learn more details about the new features and capabilities.
A key feature of this 1.4 release is the introduction of the barcode generation wizard. iText DITO 1.4 can generate both two-dimensional and three-dimensional barcodes from input data contained in the JSON payload. The wizard consists of three steps to insert a scannable barcode into your template.
In the first step you simply select the type of barcode you would like to insert, in the second you bind the barcode to a field in the data collection, and in the third step you can configure the barcode in detail.
Inserted barcode elements can be edited after insertion, or changed to another type if necessary. In regard to their size and position, barcodes behave like images and can be freely moved around or resized as required.
As of now, iText DITO supports barcodes in Code 128, Code 39, Codabar, EAN-8, EAN-13, Interleaved 2 of 5, MSI, Postnet, Planet, PDF 417, QR code and Data matrix formats. Of course, you can set type-specific configurations for all of these in the template designer.
Conditional Formatting of Alphanumeric Data Bindings
In iText DITO 1.3 we introduced conditional content: the ability to show or hide sections of your generated documents based on set conditions. This new release adds text formatting to conditions, allowing you to style data bindings depending on their value. As an example, if you want to emphasize negative numbers (e.g. by printing them bold, red and underlined) iText DITO can do that for you.
That’s not all though. You can also swap fonts, increase or decrease the font size, character or word spacing, font color, font face and decorations depending on a condition, or even a series of conditions.
This feature is designed to enable conditional text formatting configurations to be saved as reusable styles. In the example shown below, a style has been created and named “Red if negative” which can be applied to a whole list of data bindings with numeric values in your template, causing the resulting numbers in the generated documents to turn red if they are negative.
This will result in something like the following:
More complex conditional styles can also be created. In the following example we’ve defined that numbers below a certain threshold should be printed in red, while values above another threshold should be printed with increased font size and with emphasis.
Conditional styles are not limited to number-based conditions though. You can also define textual or Boolean-based style conditions for data bindings, useful for if you need to change content formatting based on a true or false condition, such as whether or not a payment has been made:
Text Formatting Preservation
The iText DITO Editor provides a wide range of text formatting capabilities at your disposal. However, sometimes data you pass to the PDF producer service may already contain formatting tags. For example, rich text fields in the user interfaces of your systems of record may store content with its layout in HTML format.
If you want to preserve this formatting, iText DITO 1.4 can now read a selection of HTML layout tags and styles and apply them. Supported tags in the first iteration of this feature are:
Supported styles are:
If a tag or style is unsupported, it will be replaced with an empty string, and all attributes except style will be ignored and removed from the tag.
To activate formatting preservation, simply tick the box in the data bind configuration. If you leave the box unticked, all tags will be considered as flat text, and printed.
Password Protection for Generated PDFs
In iText DITO 1.4 it is now possible to protect generated PDFs with a password configured at the API level.
You can set a user password which prompts users to fill out a password to open the document, an owner password which prompt users to fill out a password to interact with the document, or both, and set the appropriate protection levels through the newly added Encryption Properties of the PDF Producer operation.
The permission parameters you can configure are:
- Content copying;
- Screen reader access.
iText DITO 1.4 also introduces a number of smaller improvements:
- Broadening of the pdfProductionResult operation to throw warnings for a variety of template-related issues, with such warnings shown in preview mode;
- Extended browser support for the iText DITO Editor: as of version 1.4 Microsoft Edge 79.0 and higher are supported;
- Support for Boolean values in both conditional content and conditional formatting wizards;
- Extension of the conditional formatting options with strike-through text decoration;
- Widow and orphan control through CSS.
As usual, for a detailed rundown of what’s new in the v. 1.4 release of iText DITO, you can download the Release Preview Guide or check out the Release Notes. However, we recommend that the best way to explore the new features and capabilities is to try them out yourself with a free 30-day online trial.