Archive for the ‘PDF Library’ category

Speed and memory improvements in Docotic.Pdf 9.4

We have released Docotic.Pdf 9.4.

This version focuses on two things: memory and speed. We spent quite some time profiling the library. As the result, the library allocates less memory to parse and process documents. Less in bytes and less in the number of created objects.

We also identified and fixed some operations that were suboptimal time-wise. These bottlenecks mostly affected code for rendering PDF to images. But the new version parses PDFs faster, too.

In version 9.4, we added the ability to configure deflate compression quality for PDF streams. You can use the new PdfConfigurationOptions.DeflateQuality property to speed up saving of documents in expense of some increase in output file size.

Read about all new features and improvements in Docotic.Pdf 9.4 in the Version History document.

We encourage you to install the new Docotic.Pdf version from NuGet. You can also download the library, addons and sample code from our site.

Let us know your thoughts about the new version using e-mail or the support form. You are welcome to ask questions and suggest improvements.

Posted in

Sign PDFs using external signatures with Docotic.Pdf 9.3

We have released Docotic.Pdf 9.3 and its add-ons on our site and on NuGet.

The main new feature of this release is the ability to sign PDF documents using external signatures. You can use smart keys, USB tokens, and HSM devices to sign PDFs with digital signatures. We added new sample codes that show how to sign PDF documents using AWS KMS, sign PDF documents using Azure Key Vault, and sign PDF documents using PKCS#11 driver.

Version 9.3 fixes trim warnings and AOT compatibility issues. This improves support for trimmed and ahead-of-time compiled self-contained applications.

In response to customer reports, we decided that the library should no longer automatically detect and attach to a configured logger. Instead, we introduce the new free Docotic.Logging add-on for you to use explicitly. We have updated the Logging with log4net and the Logging with NLog code samples to show how to receive log messages from the library.

The HTML to PDF add-on now uses Chromium 121.0.6167.85. And the add-on now explicitly depends on the Newtonsoft.Json library. Previously, this dependency was merged into the add-on DLL. Please check your app dependencies if you use the add-on from ZIP. You don’t have to do anything if you use the add-on as a NuGet dependency.

Read about all new features and improvements in Docotic.Pdf 9.3 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

Nullable types and PDF marked content in Docotic.Pdf 9.2

Docotic.Pdf 9.2 is ready. We have released the library and its add-ons on our site and on NuGet.

Starting from this version, APIs of the library and all its add-ons support nullable reference types. This is to make it obvious which entities can be null and which are not. We also updated all our sample codes to take advantage of the change.

The new version brings the ability to create, extract and copy marked content. For example, it is possible to use layers within page content streams. And you can properly edit documents that use marked content. Please check the updated Edit PDF page content sample code to see how you can do this.

In version 9.2, we further improved the library memory-wise. Now fewer object collections inside the library can get to LOH. The library now uses less time and memory to copy or extract pages to a new document. We also reduced the amount of memory used to keep track of changed objects.

We implemented some important changes to the library add-ons.

The Layout add-on required .NET 6 before, but we made it compatible with .NET Standard 2.1. Now you can use the add-on from Unity, which is stuck at the older version of .NET at the moment.

The HTML to PDF add-on now uses Chromium 119.0.6045.105. There is also a breaking change: the add-on now uses transparent background color by default.

The GDI add-on now draws documents without color blending faster.

Read about all new features and improvements in Docotic.Pdf 9.2 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

PDF 2.0 and multiple digital signatures in Docotic.Pdf 9.1

We have released Docotic on our site and on NuGet. This version can process files with PDF 2.0 features like UTF-8 strings.

Also, in response to our customer requests, we added the ability to save PDFs incrementally, without changing the source PDF data. The support for incremental updates is crucial when you need to update a signed document. Writing PDFs incrementally, you can sign the same document multiple times. This is because incremental updates do not invalidate digital signatures. Use the new PdfSaveOptions.WriteIncrementally option to save incrementally.

We have added new sample codes to illustrate how incremental updates work with digital signatures:

The new version adds the ability to read and modify XFA forms. In the PdfDocument class there are new Xfa property, CreateXfaForm and RemoveXfa methods for this.

We also put a lot of work into annotations and controls. Now it is possible to flatten PDF annotations. See PdfDocument.FlattenWidgets and PdfWidget.Flatten methods. There is now support for non-standard annotation types. New version can merge controls with the same full name when appending documents.

In the HTML add-on, we have added the ability to preserve structure information (accessibility tags) in the produced PDF. Use the new HtmlConversionOptions.PreserveStructureInformation property for this.

Read about all new features and improvements in Docotic.Pdf 9.1 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

New PDF Layout API and memory optimizations in version 9

The shiny new Docotic.Pdf 9 is now available on our site and on NuGet. The new major release brings the new fluent PDF layout API and a lot of memory-related optimizations.

Many of our customers and prospects asked for a high-level layout API. These people want to add page headers and footers, tables, paragraphs, and automatically break content into pages. It is definitely an important API. With version 9, we introduce the new free Docotic.Pdf.Layout add-on with such API. Please read the overview article about the new API features.

We made a lot of changes in the library to reduce the number of memory allocations and the total amount of memory allocated. We still have a lot of ideas for improvements in this area, but Docotic.Pdf 9 allocates much fewer objects than previous versions. As the nice side-effect, it often works faster too.

The new version creates fewer objects in the Large Object Heap (LOH). And the library tries to reuse any memory it allocates. When reading, drawing, editing, or saving documents, the library reuses some of its intermediate structures. This reduces the total number of allocations and the memory footprint.

Docotic.Pdf 9 not only reuses allocated, it also allocates less when resizes an image or changes the way it compressed. The same goes for parsing fonts, saving documents with cross-reference tables, and other areas.

Read about all new features and improvements in Docotic.Pdf 9 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

3D views API and other improvements in Docotic.Pdf 8.8

We have released Docotic.Pdf 8.8 on our site and on NuGet. This release extends 3D views API and handles structure information better. This is also the last release with full support for .NET 4.7.1 and older versions of .NET 4.x.

In response to our customer request, we added the ability to create 3D views in the new version. And we changed the existing 3D views API so that it is possible to access more properties of a 3D annotation and its view.

Version 8.8 preserves structure information of the pages copied or extracted from a PDF with a structure tree. The library also properly merges structure hierarchy when merging documents. And when you remove pages with structure information, the library removes no longer used structures.

The new version finds more duplicate objects. Also, from now on, PdfDocument.ReplaceDuplicateObjects methods can also find and replace duplicate form XObjects.

Read about all new features and improvements in Docotic.Pdf 8.8 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

Sunsetting support for .NET 4 in late 2023

As you know, Microsoft drops support for older versions of .NET framework from time to time. We decided now it is time for us to make a similar move.

We are about to release Docotic.Pdf 8.8. After the release, we will start moving away from supporting .NET 4.7.1 and older versions of .NET 4.x.

We will be happy to hear your opinion about the following roadmap, so please contact us using e-mail or the support form.

Here is the roadmap:

  1. Docotic.Pdf 8.8 released on November 30th will be the last version with full support for .NET 4.7.1 and older versions of .NET 4.x.
  2. Next versions will target .NET 4.7.2 or newer and .NET Standard 2.0 or newer.
  3. We will continue to ship versions of the library for frameworks older than 4.7.2, but those versions won’t include any new features, only bug fixes.
  4. We will stop fixing issues in versions for .NET 4.7.1 and older on December 1st, 2023.

To recap, we will fix bugs in versions for .NET 4.7.1 and older for a year more. We will drop any support for .NET versions earlier than .NET 4.7.2 in December 2023. All this does not affect support for .NET Standard / .NET Core.

We believe most of our customers already use .NET 4.7.2 or newer, so the move won’t bring trouble to anyone.

Posted in

Drawing and Optimization APIs got better in Docotic.Pdf 8.7

We have released Docotic.Pdf 8.7 on our site and on NuGet. This release can compress PDFs even better than before. And it brings substantial changes to the Drawing API.

In Version 8.7 we added the ability to remove unused glyphs from existing PDF fonts. There is the new PdfDocument.RemoveUnusedFontGlyphs method for this. And the PdfFont.RemoveUnusedGlyphs method now supports existing PDF fonts.

The library also detects and replaces duplicate objects better than in previous versions. We also fixed some issues with removal of unused resources and un-embedding of fonts.

We added the ability to save PDF pages as uncompressed raster bytes in RGB, Gray-scale, and CMYK color spaces with an optional alpha channel. Please try the new ImageCompressionOptions.CreateUncompressed method.

Along with the previous change, we heavily reworked the ImageCompressionOptions class. Now all static methods of this class return instances of derived types instead of ImageCompressionOptions itself. Take a look at the new PngImageCompressionOptions, JpegImageCompressionOptions, TiffImageCompressionOptions, and UncompressedRasterOptions classes. This is a breaking change, so please contact us if you need help to migrate to the new version.

Docotic.Pdf 8.7 contains changes for the PdfSaveOptions class. We added the new RemoveSignaturePermissions option, which is true by default. This option comes in handy when you save documents with forms previously secured by a signature. Please read the remarks section in the documentation for the new property for more detail.

We changed the default value for the PdfSaveOptions.UseObjectStreams property to true. This means that now the library packs objects into compressed object streams by default. This helps to produce smaller output files but will require Adobe Reader 6 released in 2003 or newer to view produced PDF files. You can set this property to false to get the previous default behaviour.

The HTML to PDF add-on now uses Chromium 100.0.4889.0 to render web content to PDF.

Read about all new features and improvements in Docotic.Pdf 8.7 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

Docotic.Pdf 8.6 with text processing improvements

We have a new release ready. Docotic 8.6 and its add-ons are now available on our site and NuGet.

The new version contains improvements related to text processing, memory consumption, and content extraction.

With Docotic.Pdf 8.6, you can programmatically detect cases when regular text extraction methods produce garbled / unexpected text. This happens for documents that do not contain mappings of glyphs to Unicode characters. Or contains incorrect mappings.

We added the ability to specify a custom handler for character codes that define unmapped glyphs. You can use the handler to skip or replace those glyphs. Fix garbled text when extracting from PDF documents sample code shows how to use OCR to extract text properly, even if a document contains unmapped glyphs.

Docotic.Pdf 8.6 uses less memory and time to decode LZW and Flate streams. It also imports PNG images faster and using less memory. When drawing a text using a Type3 font, the library uses less time, memory, and temporary streams. Processing a document with inline images also requires less temporary streams.

To help with content extraction and copying, we have added the ability to extract and copy painted Form XObjects. It is now possible to extract blend mode with page objects. From now on, the PdfPage.GetObjects() group of methods returns invisible paths.

To showcase the changes, we added Edit PDF page content sample. And we updated the existing Copy text, paths and images between PDF pages sample.

As always, we fixed bugs in the library. The new version contains fixes for text drawing and extraction, form controls, and images.

Read about all new features and improvements in Docotic.Pdf 8.6 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in

Add RTL and bidirectional text to PDF with Docotic.Pdf 8.5

We have released Docotic.Pdf 8.5 and its add-ons. They are now available on our site and NuGet.

We improved support for RTL and bidirectional text in the new version. Last year the library got the ability to extract RTL and bidirectional text properly. In version 8.5, we added the ability to specify base direction when drawing right-to-left and bidirectional text on PdfCanvas.

There are also changes in the API for images. With the new version, you can access low-level image streams. It is now allowed to uncompress mask images and recompress them with Flate.

With Docotic.Pdf 8.5, it is possible to retrieve extended properties of a timestamp token embedded in a signature. And we also improved the verification of ECDSA signatures.

We fixed quite some bugs reported by our customers and prospects. Some of the areas affected are JPEG extraction and importing code, text extraction, decoding of CCITT images, and parsing of fonts.

Read about all new features and improvements in Docotic.Pdf 8.5 in the Version History document.

We encourage you to download and try the new version. This version is also available on NuGet.

Please tell us your thoughts about the new version using e-mail or the support form. Don’t hesitate to write us your questions, suggest features, or ask for help.

Posted in