Table of Contents

Enum PdfDocumentOpenMode

Namespace
PdfSharp.Pdf.IO
Assembly
PdfSharp.dll

Determines how a PDF document is opened.

public enum PdfDocumentOpenMode

Fields

Append = 4

The PDF stream is completely read into memory and can be modified, and saving the document writes an incremental update: the original bytes are kept unchanged and only new and changed objects are appended. Existing digital signatures therefore stay valid, and a further signature can be added. Object numbers and the page tree are kept. An encrypted document keeps its encryption, which cannot be changed or removed in this mode, and an unencrypted document cannot be encrypted.

Import = 1

The PDF stream is opened for importing pages from it. A document opened in this mode cannot be modified, but you can extract pages from it.

[Obsolete("InformationOnly is not implemented, use Import instead.")] InformationOnly = 3

The PDF stream is partially read for information purposes only. The only valid operation is to call the Info property at the imported document. This option is very fast and needs less memory and is e.g. useful for browsing information about a collection of PDF documents in a user interface.

Modify = 0

The PDF stream is completely read into memory and can be modified. Pages can be deleted or inserted, but it is not possible to extract pages. This mode is useful for modifying an existing PDF document.

[Obsolete("ReadOnly is not implemented, use Import instead.")] ReadOnly = 2

The PDF stream is completely read into memory, but cannot be modified. This mode preserves the original internal structure of the document and is useful for analyzing existing PDF files.