It’s Valentine's Day, although that’s not all we’re celebrating. 24 years ago today, the first public version (0.30) of the iText PDF library was released. Today, we give you iText Suite version 8.0.3 which has a ton of great stuff we’re sure you’re going to love.
After almost a quarter-century of iText development, you might be wondering what else could we possibly add to the premier open-source PDF library for Java and .NET. As we mentioned last time, our current focus is to build upon iText Core’s already industry-leading support for PDF digital signatures, making digital signing with iText easier than ever before. By providing developers with more high-level APIs to utilize, it means you don’t have to bother with any specification or implementation details - iText will do all the heavy lifting for you.
On top of that though, we’ve also been implementing support for the upcoming PDF/UA-2 standard, improved our automated checks for PDF/A and PDF/UA creation in Core and pdfHTML, and added support for intelligent table recognition in pdfOCR.
Release iText Core 8.0.3
Digital Signatures
PAdES Signing high-level API
You might remember that in our last release we mentioned a new high-level API for PDF Advanced Electronic Signatures (PAdES) Signing, While we were still working on the finer details, we wanted to allow interested parties to try it out and familiarize themselves with it. Now, we’re happy to say it is finalized and completely ready for production.
The main addition is the new PdfPadesSigner
class, which performs signing with the PAdES related profiles (В, T, LT, LTA) and renews signature revocation data (AKA prolongation) and timestamps. See the example on our Knowledge Base for more details on the various PAdES levels, along with a demonstration of creating a Level B and Level LTA signature using the PdfPadesSigner
class.
Note that while PAdES was published by the European Technical Standards Institute (ETSI), other implementations of Advanced Electronic Signatures (AES) and Qualified Electronic Signatures (QES) for PDF work in a similar way. So, even if you don’t require eIDAS-specific compliance, you should find this API extremely useful.
Two-step/asynchronous signing
The PAdES Signing API also includes a comprehensive implementation of two-step (AKA asynchronous) signing. In essence, this means users are now able to easily split signing operations into steps which can be performed independently of each other. While this was possible beforehand, doing so required a deep knowledge of signing and not a little effort.
To make things more straightforward we’ve added two methods to the PadesTwoPhaseSigner
class (Java/.NET). The first is prepareDocumentForSignature
which adds the necessary fields to the document, closes it and then returns the message digest of the prepared document. The second method is addSignatureToPreparedDocument
which, as the name suggests, completes the signing procedure by adding the signature to the prepared document.
That’s not all though. We’ve also added the PadesTwoPhaseSigningHelper
class (Java/.NET); a helper class that allows users to easily perform signing operation in two steps. For example, you could prepare the document with a placeholder for the future signature, and then sign the prepared document using a corresponding PAdES profile at a later date, or using a completely separate process or application.
Once again, we have prepared an example on our Knowledge Base to show you how it works.
Additional SignatureFieldAppearance examples
In addition to the examples we featured in our previous release, we’ve prepared a few more examples demonstrating the advanced customization for digital signature fields using the new methods in iText Core.
Improved chain logic for missing certificates
We’ve also improved iText’s signing logic for certificate chains and the collection of revocation data for CRL response certificates. Previously, when iText requested a certificate chain for signing logic, it expected that all required certificates in a chain would be present in a common location. However, it is now possible for missing intermediate certificates to be received externally through the use of Authority Information Access (AIA) extensions, which point the client to a location where the necessary certificates can be obtained.
Customizable signature orientation
In a previous version, we introduced some logic where iText would automatically try to adjust signature fields to match the orientation of the document. While this works well in most cases, there may be situations where you don’t want this to happen. We’ve now introduced a parameter that sets the orientation of the signature appearance itself, which will override the default behavior in such cases.
Support for SM2/SM3 signing
In relation to a pull request, we added support for signing with the SM2/SM3 algorithms which are becoming more commonplace in China. In response to this request we provided an example which is a neat demonstration of how you can take advantage of the algorithm-agnostic signing and validation introduced in the 8.0.1 release. If you make use of these algorithms and can validate the sample code and signature in the output PDF, please report back with your findings!
Digital Signature Knowledge Base updates
On a related note, we’ve recently overhauled our Digital Signing with iText series of articles on the iText Knowledge Base to account for the API improvements in iText Core version 8. This is a comprehensive series that walks through the process and use cases of digitally signing PDFs, and includes a wealth of information plus handy code snippets along with links to the complete signing examples used for the articles.
Another new addition to our Digital Signing Hub is a complete list of support in iText Core for the PDF Digital Signature Extensions. This details all current ISO/TS 32001, ISO/TS 32002 and ISO/TS 32003 extensions to the ISO 32000-2 (PDF 2.0) specification, and will be continually updated as necessary.
Speaking of PDF 2.0, don’t forget that this is now available at no cost, thanks to the unique collaboration between the three leading PDF companies (including Apryse) and the PDF Association. Visit the the PDF Association website to learn more and download the ISO 32000-2 bundle.
PDF/UA-2 support
Our devs have been hard at work implementing support for creating documents compliant with the new PDF/UA-2 standard. Similarly to the latest PDF/A-4 standard for Archiving, PDF/UA-2 is based upon the PDF 2.0 specification and implements a number of improvements over the existing PDF/UA-1 standard.
PDF/UA-2 introduces extensive support for annotations and structure element attributes, which were largely absent in PDF/UA-1. In addition, PDF/UA-2 utilizes PDF 2.0 to its advantage in numerous ways. This includes the innovative Namespaces feature that enables the integration of PDF 1.7 and PDF 2.0 structure elements within the same document, the introduction of MathML, the new Artifact structure element type, and a host of other enhancements.
Thanks to our long-standing collaboration with the PDF Association and the ISO Technical Committees for the PDF standards, we have been closely involved in the development of PDF/UA-2, and so we feel it is important to implement early support in iText to help popularize and promote this new standard.
Additional checks for PDF/A and PDF/UA generation
To assist with the creation of compliant PDF/A and PDF/UA documents we’ve implemented extra checks and helper logic in our Kernel
module to guide users, and detect compliance issues early in the process.
Bug fixes and miscellaneous
We’ve fixed some issues relating to text extraction and flattening, plus a fix for incremental updates to hybrid-reference files. Plus, we made some other miscellaneous improvements and fixes across the board. As always, check the Changelog for more details.
Also, in the release notes you can find links to our Java and .NET GitHub repositories which are continually updated with useful code samples for iText Core and its add-ons.
Pull Requests
This time, we’d like to thank Snipx for their pull request to implement support for the SVG stroke-dasharray attribute, which we embellished with support for stroke-dashoffset and also percent values in addition to absolute values. Also, a shoutout to mike1226 who made a similar submission recently.
We recognize that iText would not be the success it is today without the contributions from our wonderful community. So, a happy Valentine’s Day to you all, and your contributions are always welcomed!
Release pdfHTML 5.0.3
pdfHTML is an iText Core add-on for Java and .NET to create PDF from HTML/XML (and associated CSS).
As we mentioned above, we’ve implemented additional checks and improvements during the creation of PDF/A and PDF/UA to make the creation of both archivable and universally accessible PDF documents easier. Using HTML as a source is a great way to create such documents, so pdfHTML users naturally benefit greatly from this addition.
As for PDF/A, if you want to create documents compliant with the new PDF/A-4 standard, check out this example from last time.
We’ve also fixed some bugs with converting layout elements and an exception being thrown when emojis are present in HTML to PDF/A conversions.
Release pdfOCR 3.0.2
pdfOCR is our add-on for iText Core to perform OCR on documents and images.
In this release we’ve added support for pdfOCR to be able to intelligently recognize table data and convert it into the correct tag structure in the resulting PDF documents.
A bug for the incorrect font size being selected for particularly small text was also fixed.
Release pdfSweep 4.0.2
pdfSweep is an iText Core add-on for Java and .NET to securely redact content from PDFs.
This release fixes a bug where a NullPointerException could occur in situations where an Image's XObject was directly referenced from the canvas, had an /ImageMask entry with the value true
and was completely covered by a cleanup rectangle.
Release pdfXFA 4.0.3
pdfXFA is an iText Core add-on for Java and C# (.NET) that allows you to flatten dynamic XFA forms to static PDF. It also enables you to add a digital signature to converted XFA forms as additional security for further processing in PDF workflows or for archiving.
For this release of pdfXFA, we fixed a bug where if the XFA data contained HTML tags for bulleted and numbered lists, the flattened version would use an incorrect symbol for lists - for example, the •
symbol would be replaced with the -
character. Now, pdfXFA will preserve these characters in the flattened PDF document.
Final thoughts
2023 was a rollercoaster year for iText, beginning with the release of iText Suite 7.2.5 in January, and us becoming part of the Apryse family in February - speaking of which, birthday greetings go to Apryse as well! Then May saw the release of iText version 8, which brought many improvements in digital signing, built-in support for the Federal Information Processing Standard (FIPS 140-2), and layout-based forms creation.
August followed that up with iText Suite 8.0.1 featuring improved CSS flex support and the introduction of multi-column support for the pdfHTML add-on. And of course, we ended the year with iText Suite 8.0.2 which added comprehensive support for the latest PDF/A-4 standard, customizable annotation flattening, and even more digital signing enhancements.
What do we have coming up in future releases? You'll have to stick around to find out!
Don’t forget, you can get a free 30-day trial of the entire iText Suite under the terms of our commercial license, which enables you to keep your intellectual property safe.
Until next time, happy coding!