PdfSaveOptions Class

The options of PdfDocument.Save.

public sealed class PdfSaveOptions

Remarks

The output of a save depends only on the document and the options: the same document gives the same bytes.

Constructors

NameDescription
PdfSaveOptions()

PdfSaveOptions()

PdfSaveOptions.cs
public PdfSaveOptions()

No documentation is available.

Properties

NameDescription
CompressStreamsGets a value indicating whether the streams without filter are compressed with FlateDecode. The default is true.
DefaultGets the default options.
LinearizeGets a value indicating whether the file is linearized for fast web view (ISO 32000-2, Annex F): the objects of the first page come first, with hint tables that let a viewer show each page before the file is fully downloaded. The default is false.
UseObjectStreamsGets a value indicating whether the objects that are not streams are written in object streams, with a cross-reference stream (PDF 1.5, ISO 32000-2, 7.5.7 and 7.5.8). The default is true. An incremental save keeps the kind of cross-reference of the original file: it writes the objects of the update in object streams when the file has cross-reference streams.
VersionGets the version written in the header, or null (the default) for the version of the document, raised to what the options need.
XmpPaddingGets the number of whitespace bytes the XMP packet the save writes for PdfDocument.PdfAConformance and PdfDocument.PdfUAConformance reserves before its end, so that an editor can update the packet in place. The default is 0.

CompressStreams

PdfSaveOptions.cs

Gets a value indicating whether the streams without filter are compressed with FlateDecode. The default is true.

public bool CompressStreams { get; init; }

Property value

bool

Gets the default options.

public static PdfSaveOptions Default { get; }

Property value

PdfSaveOptions

Gets a value indicating whether the file is linearized for fast web view (ISO 32000-2, Annex F): the objects of the first page come first, with hint tables that let a viewer show each page before the file is fully downloaded. The default is false.

public bool Linearize { get; init; }

Property value

bool

Remarks

A linearized file uses cross-reference tables and no object stream (PdfSaveOptions.UseObjectStreams is ignored), and is built in memory before it is written. The inheritable attributes of the page tree are written on the pages. It cannot be encrypted, and an incremental save cannot be linearized: an incremental update of a linearized file keeps the original file, which is then no longer linearized.

UseObjectStreams

PdfSaveOptions.cs

Gets a value indicating whether the objects that are not streams are written in object streams, with a cross-reference stream (PDF 1.5, ISO 32000-2, 7.5.7 and 7.5.8). The default is true. An incremental save keeps the kind of cross-reference of the original file: it writes the objects of the update in object streams when the file has cross-reference streams.

public bool UseObjectStreams { get; init; }

Property value

bool

Gets the version written in the header, or null (the default) for the version of the document, raised to what the options need.

public PdfVersion? Version { get; init; }

Property value

PdfVersion?

Gets the number of whitespace bytes the XMP packet the save writes for PdfDocument.PdfAConformance and PdfDocument.PdfUAConformance reserves before its end, so that an editor can update the packet in place. The default is 0.

public int XmpPadding { get; init; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is negative.