PdfDocumentSummary Class

A summary of the structure of a document: its pages, and the graph of the objects reachable from the trailer, with a digest that does not depend on the numbers of the objects.

public sealed class PdfDocumentSummary

Remarks

Two documents with the same digest have the same objects, linked the same way, whatever their object numbers, their cross-reference sections and their object streams. The digest ignores the entries of the trailer that describe the file rather than the document (/ID, /Size, /Prev, /XRefStm, /Encrypt), and compares the streams by their encoded data and dictionary.

Properties

NameDescription
DigestGets the SHA-256 digest of the object graph, in hexadecimal, independent of the object numbers.
ObjectCountGets the number of indirect objects reachable from the trailer.
ObjectKindsGets the number of indirect objects reachable from the trailer, by kind.
ObjectTypesGets the number of indirect dictionaries and streams reachable from the trailer, by their /Type (the dictionaries without type are not counted).
PagesGets the summaries of the pages, in order.

Gets the SHA-256 digest of the object graph, in hexadecimal, independent of the object numbers.

public string Digest { get; }

Property value

string

Gets the number of indirect objects reachable from the trailer.

public int ObjectCount { get; }

Property value

int

Gets the number of indirect objects reachable from the trailer, by kind.

public IReadOnlyDictionary<PdfObjectKind, int> ObjectKinds { get; }

Gets the number of indirect dictionaries and streams reachable from the trailer, by their /Type (the dictionaries without type are not counted).

public IReadOnlyDictionary<string, int> ObjectTypes { get; }

Gets the summaries of the pages, in order.

public IReadOnlyList<PdfPageSummary> Pages { get; }

Methods

NameDescription
Create(PdfDocument)Summarizes a document.

Create(PdfDocument)

PdfDocumentSummary.cs

Summarizes a document.

public static PdfDocumentSummary Create(PdfDocument document)

Parameters

document PdfDocument
The document.

Returns

PdfDocumentSummary The summary.

Exceptions

PdfException
The page tree of the document cannot be read.