THPDFRenderDocAccess Record
Binds the renderer to document services for resolving references, reading streams, decoding images, locating fonts, and evaluating layer visibility
Declaration
THPDFRenderDocAccess= record
Context: Pointer;
SharedCache: THPDFRendererSharedCache;
ShareRenderCaches: boolean;
// v2.375.0 generic indirect-ref resolver (any object type). The typed
// Resolve* fields below predate it and return nil for non-matching
// types, which silently dropped indirect refs to arrays (e.g. a
// /ColorSpace entry pointing at a [/Separation ...] array object)
ResolveObject: function(Context: Pointer; Obj: THPDFObject): THPDFObject;
ResolveDictionary: function(Context: Pointer; Obj: THPDFObject): THPDFDictionaryObject;
ResolveStream: function(Context: Pointer; Obj: THPDFObject): THPDFStreamObject;
ReadDecodedStreamBytes: function(Context: Pointer; Stream: THPDFStreamObject; out Bytes: TBytes): boolean;
AcquireDecodedImageStream: function(Context: Pointer;
Stream: THPDFStreamObject): IHPDFDecodedBitmapHandle;
DecodeImageStream: function(Context: Pointer; Stream: THPDFStreamObject): TBitmap;
BeginProgressiveImageDecode: function(Context: Pointer;
Stream: THPDFStreamObject;
CancellationToken: THPDFCancellationToken): IHPDFProgressiveImageDecoder;
DecodeImageRegion: function(Context: Pointer; Stream: THPDFStreamObject;
RegionLeft, RegionTop, RegionRight, RegionBottom,
DesiredWidth, DesiredHeight: Integer): TBitmap;
AcquireDecodedImageRegion: function(Context: Pointer;
Stream: THPDFStreamObject; RegionLeft, RegionTop, RegionRight,
RegionBottom, DesiredWidth,
DesiredHeight: Integer): IHPDFDecodedBitmapHandle;
// v2.425.0 inline-image decoder: builds a throwaway stream from the raw
// ID..EI bytes and the normalised BI key set, then decodes it without the
// ObjectNumber-keyed cache (inline images have no object number). Returns
// a TBitmap the caller owns, or nil on failure. Nil hook = inline images
// are not rendered (legacy behaviour)
DecodeInlineImage: function(Context: Pointer; const Bytes: TBytes;
const Keys: THPDFInlineImgKeys): TBitmap;
// Colour-key /Mask array of an image XObject as a soft mask, white where
// the image shows and black where it is masked out. Returns a TBitmap the
// caller owns, or nil when the image has no usable colour-key mask; a nil
// hook draws such images unmasked
DecodeColorKeyMask: function(Context: Pointer;
Stream: THPDFStreamObject): TBitmap;
// Look up a font dictionary by resource key in a Resources dict, following
// indirect refs at both /Resources and /Font levels. Returns nil if absent
ResolveFontDict: function(Context: Pointer; PageObj: THPDFDictionaryObject;
const FontKey: AnsiString): THPDFDictionaryObject;
// v2.377.0 optional-content visibility oracle: evaluates an /OC property
// object (OCG or OCMD) against the document's layer states. Nil hook or
// a True result means the content is drawn
EvalOCVisibility: function(Context: Pointer; PropObj: THPDFObject): boolean;
CancellationToken: THPDFCancellationToken;
ColourIntent: Integer;
FallbackPolicy: THPDFRenderFallbackPolicy;
FallbackDiagnosticLimit: Integer;
OverprintPreview: boolean;
ProofICCProfile: TBytes;
OutputICCProfile: TBytes;
BlackPointCompensation: boolean;
SeparationPlate: AnsiString;
end;
Unit
HPDFPageRenderer
Fields
| Field | Purpose |
|---|---|
Context | Caller-supplied context pointer passed as the first argument of every callback; the document binds itself here |
SharedCache | Renderer cache that several pages can share when ShareRenderCaches is enabled |
ShareRenderCaches | True when the document lets concurrent renderers share decode caches |
ResolveObject | Generic indirect-reference resolver for any object type; added because the typed resolvers return nil for non-matching types |
ResolveDictionary | Resolves an indirect reference to a dictionary object, nil for other types |
ResolveStream | Resolves an indirect reference to a stream object |
ReadDecodedStreamBytes | Reads a stream fully decoded into a byte array |
AcquireDecodedImageStream | Decodes an image XObject into a shared, reference-counted bitmap handle |
DecodeImageStream | Decodes an image XObject into a caller-owned bitmap |
BeginProgressiveImageDecode | Starts a cancellable progressive decoder for a large image stream |
DecodeImageRegion | Decodes a sub-region of an image at a requested pixel size |
AcquireDecodedImageRegion | Region variant returning a shared, reference-counted bitmap handle |
DecodeInlineImage | Decodes an inline image from raw ID..EI bytes and the normalized BI key set, bypassing the object-number cache; nil hook means inline images are not rendered |
DecodeColorKeyMask | Turns the color-key /Mask array of an image XObject into a white-and-black soft mask the size of the image; nil when the image has no usable color-key mask, and a nil hook draws such images unmasked |
ResolveFontDict | Looks up a font dictionary by resource key, following indirect references at the /Resources and /Font levels; nil when absent |
EvalOCVisibility | Evaluates an /OC property object against document layer states; nil hook or a True result means the content is drawn |
CancellationToken | Cancellation token checked during long decode operations |
ColourIntent | Color handling intent applied to the rendered graphics state |
FallbackPolicy | Selects whether unsupported features are ignored, reported, or treated as strict failures |
FallbackDiagnosticLimit | Caps the number of diagnostic messages collected while falling back |
OverprintPreview | Enables overprint preview simulation |
ProofICCProfile | ICC profile bytes used for the proofing side of the color pipeline |
OutputICCProfile | ICC profile bytes describing the output device |
BlackPointCompensation | Enables black point compensation in the ICC transform |
SeparationPlate | Name of the separation plate to isolate; empty renders normally |
Usage notes
- THotPDF binds every hook through its internal
MakeRenderDocAccesshelper, so applications receive a ready record instead of filling one in - Custom render backends read these hooks from
THPDFPageRenderBackendRequestinstead of reaching into the document directly - Leave
DecodeInlineImageorEvalOCVisibilitynil to restore the legacy behavior of skipping inline images and drawing all optional content