PDF Linearization

DynamicPDF Core Suite for .NET V12.xx can produce both linearized and single-pass (non-linearized) PDFs.

PdfFormat

The Document class's PdfFormat property specifies if a PDF is linearized. This property is a PdfFormat enumeration that specifies if a PDF is linearized or non-linearized.

PdfFormat.Linearized
PdfFormat.SinglePass
PdfFormat.Linearized
PdfFormat.SinglePass

Generally, when creating a large PDF for downloading over the web, linearize the PDF. However, only linearize a PDF if the processing resources while creating the PDF are not limited. The following discusses the advantages and disadvantages of linearizing a PDF.

Linearized PDFs

A linearized PDF placed on a web server as a file (also known as "fast web view") offers a substantial advantage over a non-linearized PDF because it is downloaded more quickly. The first page of the PDF displays quicker, as the PDF begins displaying in a web browser before the entire PDF is downloaded. A PDF's pages are also "lazy loaded" and only downloaded as needed. Linearized PDFs are also optimized in other ways to ensure the PDF loads quicker than non-linearized PDFs.

The primary drawback of linearizing a PDF is that the PDF requires more processing resources while creating the PDF, resulting in a slightly larger file size. Another disadvantage is that "lazy loading" of PDF pages only works for static files on a web server.

Single Pass (Non-Linearized) PDFs

Non-linearized PDFs (single pass output) flush content to the output stream as quickly as possible as the PDF is created, requiring fewer processing resources and resulting in a slightly smaller file size.

The disadvantage is that the PDF is not optimized for downloading over the web, and the full PDF must be downloaded before a browser can begin displaying the PDF.

In this topic