Class PdfObjectResolver
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
streamPdfStreamA stream of this document (for example from Resolve(int)).
Returns
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
streamis 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
objPdfObject
Returns
Resolve(int)
public PdfObject? Resolve(int objectNumber)
Parameters
objectNumberint