Alternative utilities for PDF

In addition to programs from Adobe, there are many alternative specialized libraries and utilities for working with PDF. Tellingly, open source tools are often even more convenient than official* software. Alternative readers / editors are very different in functionality from Adobe. In turn, the Adobe programs themselves differ from the official PDF specifications.

*Note: Adobe programs are not “official” in the truest sense of the word, because PDF is open And free ISO standard.


There are at least three classes of sets:

  1. functions from PDF specifications of different versions (largest sets);
  2. functions of “official” Adobe Acrobat/Acrobat Pro/Reader (several more sets);
  3. functions of alternative readers, utilities and libraries for PDF processing.

In 2017–2023, the adoption of

PDF 2.0 standards package

, which replaced previous versions of PDF 1.0–1.7. It requires the implementation of new features while maintaining backward compatibility. An extremely difficult task.

In practice, it is sometimes more convenient to use lightweight third-party tools that only support Part PDF specs, but only the right stuff, no legacy load. Among them are specialized utilities that perform one task, but are better than commercial tools.

Library for generating PDF

As a concrete example, you can take a look at the small library

CapyPDF

by Jussi Pakkanen. This is a PDF generation library, it implements a small part of the standard, and some functions

implemented but not open for use

. For example, the following functions in the current PDF rendering:

  • Basic graphics commands for RGB, grayscale and CMYK
  • Support for ICC profiles
  • Download PNG, JPG and TIFF images (including CMYK TIFF)
  • Inserting JPG files directly without decompressing first
  • Using images as masks for painting
  • Working with color profiles embedded in images
  • Using Embedded PDF Fonts
  • Use of TrueType fonts, including the ability to truncate a subset of fonts (font subsetting)
  • All PDF font operators such as extra padding, upper/lower case and clipping path
  • Page transitions

Implemented, but not open (the code is there, but not added or formatted as comments):

  • Document navigation tree

  • Overprint (imposition of one color element on another without creating a reverse)
  • Structure and annotations
  • Additional color channels (in the PDF specification they are called separations)
  • Objects XObjects for forms
  • Embedding files
  • Annotations (only a few types)
  • L*a*b* color space support
  • ICC colors in primitive fill operations
  • Shades Type 2, 3 and 4 (e.g. gradients)
  • color patterns

And there are other features that do not quite match the specifications. Let’s say

navigation within pages

. According to the PDF 2.0 specifications, section 12.4.4.2, it is possible to implement many items on the same page, which will open one after the other on a mouse click. It’s made for presentations. However, almost all PDF generators implement a list not on one, but on several pages. That is, a list of five items takes not one, but five pages. The only reader that supports navigation within pages is Acrobat Reader. But right now, no PDF generator, no presentation software exports page navigation tags.

Cause in vagueness of wording official specification, so this function is difficult to implement in an unambiguous way. There, optional content groups and navigation nodes are used as basic operations. The former are supported by all PDF readers, the latter are not. Each navigation node represents a state. As the user navigates back and forth, the reader performs an action that can be used to hide or show an optional content group. According to the specification, the system works according to a complex bidirectional algorithm:

By opinion some developers, introducing a root into this scheme is an unnecessary complication. On the other hand, this option allows almost any document to be implemented as a single-page PDF with many “states”.

Here, the specifications themselves need to be corrected, because some parts there contradict each other.

To sum up, CapyPDF cannot open and edit documents, but it does one specific task – PDF generation – as far as the specifications allow.

Engines for rendering PDF in browsers

In addition to individual PDF readers / editors, special attention should be paid to

browser rendering engines

and web editors. They also become more functional with each new version. For example, in Firefox since version

106

(October 2022) a built-in PDF editor appeared, including adding text and drawing shapes, including signatures:

Firefox allows you to annotate: type or handwrite directly into the PDF, choose color, size, line weight, opacity, etc., and then save the PDF file locally with new additions.

We recently talked about a very convenient web editor. simplePDFfocused on the simplest and fastest manipulations with PDF, such as:

  • enter the name in the PDF form;
  • tick the boxes;
  • put a signature;
  • Add photo.

Demo:

Unfortunately, online PDF editors do not yet support signing documents with digital certificates, editing protection, and other security features that are available on the Adobe PDF platform.

Separate tools can also be used to digitally sign a PDF. For example, a simple open source utility open-pdf-sign from the command line. Signatures are invisible (default) or explicitly shown:

The console utility can be used with existing certificates from any certification authorities.

In general, the PDF 2.0 standard is so complex and voluminous that it is extremely difficult to implement it entirely according to the specifications in one program. For example, the main document ISO 32000-2:2020 – Document management – Portable document format – Part 2: PDF 2.0 contains 1003 pages:

Several more applications have been adopted to it, including an application on digital signatures ISO/TS 32002:2022and these are just two of the six documents in the PDF 2.0 standards suite.

In general, it is sometimes more efficient to use small specialized utilities. Such open source utilities exist separately for generating, viewing and signing PDFs.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *