UniPDF v4 Released

UniPDF Version 4 has been released. The release adds new features to extract text, and adds the Grid component to layout design, and comes with various improvements in the library.

UniPDF Version 3 built a solid base with support for composite fonts and digital signatures, PDF optimization as well as improved extraction of text and images. Version 4 expands on this foundation by offering developers more precise tools to perform typical PDF manipulation tasks.

New Text Extraction Modes

UniPDF version 4 introduces configurable options for extracting text, allowing developers to choose the format of output that is most suitable for their needs. The ExtractionMode configuration now offers three options:

  • ExtractionModeLayout: This is the default mode, carried over from v3. It keeps the document’s visual layout, which includes lines and paragraphs.

  • ExtractionModePlain: This new mode extracts text content in a sequential fashion without affecting formatting, such as lines and paragraphs. It’s helpful when just the raw text stream is needed to be processed.

  • ExtractionModeLayoutNoBreaks: This mode is similar to ExtractionModeLayout but removes line breaks that occur within a single horizontal line of text. This is helpful when processing texts where artificial breaks in sentences are not required.

These options offer greater control over the extraction of text according to the specific needs of the application.

New Grid Component for Layouts

Version 4 introduces the Grid component to the Creator package. In contrast to the Table component it needs a clear definition of rows as well as their cells. This method gives an immediate control on the layout and layout of elements, which makes it ideal for designing specific layouts or tables that have complicated structure.

Code examples demonstrating the Grid component, including features like column spanning (colspan), row spanning (rowspan), and content wrapping, are available in the unipdf-examples repository: https://github.com/unidoc/unipdf-examples/tree/master/grid

Deprecation of Paragraph Component

The Paragraph component of the creator package has been removed in version 4 and scheduled to be removed in a subsequent release. Developers should make use of the StyledParagraph component. StyledParagraph gives more alternatives for using text styles, alignment and formatting when compared with the earlier Paragraph component.

Other Changes

UniPDF version 4 also contains the following enhancements that include:

  • SVG Gradient Rendering: The handling of the gradient color in SVG images included in PDFs has been improved to provide more uniform rendering.

  • PdfObject.Write Method: The internal PdfObject.WriteString method has been replaced by Write, which returns a byte array ([]byte). This modification improves the internal handling of data.

  • Cumulative Fixes: This release contains bug fixes as well as stability updates derived from the most recent UniPDF version 3 service release.

Getting UniPDF v4

UniPDF version 4 provides developers with more control over the extraction of text as well as a new tool to assist with layout generation. We suggest users upgrade to v4 in order to take advantage of these improvements and enhancements.

Ready to unlock the full potential of UniPDF v4? Contact us for more details, or if you’re new to UniPDF, start your 14-day free trial today. Let’s give it a try!