Click or drag to resize

Document Structure

The PDF document structure specifies how the basic object types are used to represent components of a PDF document: pages, fonts, annotations and so forth.

The following section gives more information about PDF document components currently implemented in GemBox.Pdf.

Document Structure

The root of the Document Structure as specified in PDF Specification ISO 32000-1:2008, section '7.7 Document Structure' in GemBox.Pdf is PdfDocument type.

PdfDocument currently contains the reference to the following complex PDF components:

Note Note

For each PDF component, the underlying PdfDictionary or PdfArray can be accessed, as explained in Objects.

But note that for some PDF components that are optional and unchanged, the underlying PdfDictionary or PdfArray instance might be null.

Page Tree

The pages of a document are accessed through a structure known as the page tree, which defines the ordering of pages in the document.

Using the tree structure, conforming readers using only limited memory can quickly open a document containing thousands of pages.

The tree contains nodes of two types:

  • intermediate nodes, called page tree nodes, implemented in PdfPages class and

  • leaf nodes, called page objects, implemented in PdfPage class.

Note Note

The simplest structure can consist of a single page tree node that references all of the document’s page objects directly.

However, to optimize application performance, a conforming writer can construct trees of a particular form, known as balanced trees.

GemBox.Pdf provides two views of the document’s page tree:

Base class for both intermediate PdfPages node and leaf PdfPage node is PdfPageObject that contains inheritable properties. If an intermediate PdfPages node or a leaf PdfPage node does not set an inheritable property, then the property value will be inherited from the first ancestor PdfPages node that has that inheritable property set, or the property value will be represented by a default value if no ancestor PdfPages node has that inheritable property set.


PDF document and page tree nodes can be cloned.

To clone the entire document, use PdfDocumentClone method.

To clone the specific page, use either PdfPages methods AddClone(PdfPage) and InsertClone(Int32, PdfPage) or PdfPageObjectCollection methods AddClone(PdfPageObject) and InsertClone(Int32, PdfPageObject).

For more information, see Cloning example.

See Also