Table of Contents

Class PdfObjectResolver

Namespace
PdfEngine.Vector.Parsing
Assembly
PdfEngine.Vector.dll

Resolves indirect object references from classic xref offsets or modern object streams (/ObjStm) with cycle detection and caching.

public sealed class PdfObjectResolver
Inheritance
PdfObjectResolver
Inherited Members

Methods

DecodeStream(PdfStream)

Decodes the data of stream: applies every filter of its /Filter entry in order, with the matching /DecodeParms (indirect entries are resolved through this resolver). A stream that this resolver read from an encrypted document is already decrypted, so the result is the plain data. The document's PdfSecurityLimits apply, as they do to the engine's own decoding.

public byte[] DecodeStream(PdfStream stream)

Parameters

stream PdfStream

A stream of this document (for example from Resolve(int)).

Returns

byte[]

A new array with the decoded data. PdfStream itself is not changed.

Remarks

The four Pdf*Exception types above derive from PdfVectorException. The method never returns null. It supports FlateDecode, LZWDecode (both with predictors), ASCIIHexDecode, ASCII85Decode, RunLengthDecode and the /Identity crypt filter. It is safe to call while other threads resolve objects of the same document.

Exceptions

ArgumentNullException

stream is null.

PdfUnsupportedFeatureException

A filter is not a general-purpose filter that the engine decodes: an image codec (DCTDecode, JPXDecode, JBIG2Decode, CCITTFaxDecode), an unknown filter, or a crypt filter other than /Identity on a stream that was not decrypted.

PdfSyntaxException

The /Filter entry is malformed, or the data cannot be decoded.

PdfResourceLimitException

The decoded data is larger than the limits allow.

PdfDataNotLoadedException

The document loads by HTTP ranges (PdfRangedDocument) and the bytes of the stream, or of an object its /Filter or /DecodeParms refers to, are not loaded yet. Load them and call again.

ObjectDisposedException

The document, and so its byte source, is disposed.

IOException

The document's file could not be read (a PdfFileByteSource).

Resolve(PdfObject?)

public PdfObject? Resolve(PdfObject? obj)

Parameters

obj PdfObject

Returns

PdfObject

Resolve(int)

public PdfObject? Resolve(int objectNumber)

Parameters

objectNumber int

Returns

PdfObject