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

FieldPurpose
ContextCaller-supplied context pointer passed as the first argument of every callback; the document binds itself here
SharedCacheRenderer cache that several pages can share when ShareRenderCaches is enabled
ShareRenderCachesTrue when the document lets concurrent renderers share decode caches
ResolveObjectGeneric indirect-reference resolver for any object type; added because the typed resolvers return nil for non-matching types
ResolveDictionaryResolves an indirect reference to a dictionary object, nil for other types
ResolveStreamResolves an indirect reference to a stream object
ReadDecodedStreamBytesReads a stream fully decoded into a byte array
AcquireDecodedImageStreamDecodes an image XObject into a shared, reference-counted bitmap handle
DecodeImageStreamDecodes an image XObject into a caller-owned bitmap
BeginProgressiveImageDecodeStarts a cancellable progressive decoder for a large image stream
DecodeImageRegionDecodes a sub-region of an image at a requested pixel size
AcquireDecodedImageRegionRegion variant returning a shared, reference-counted bitmap handle
DecodeInlineImageDecodes 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
DecodeColorKeyMaskTurns 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
ResolveFontDictLooks up a font dictionary by resource key, following indirect references at the /Resources and /Font levels; nil when absent
EvalOCVisibilityEvaluates an /OC property object against document layer states; nil hook or a True result means the content is drawn
CancellationTokenCancellation token checked during long decode operations
ColourIntentColor handling intent applied to the rendered graphics state
FallbackPolicySelects whether unsupported features are ignored, reported, or treated as strict failures
FallbackDiagnosticLimitCaps the number of diagnostic messages collected while falling back
OverprintPreviewEnables overprint preview simulation
ProofICCProfileICC profile bytes used for the proofing side of the color pipeline
OutputICCProfileICC profile bytes describing the output device
BlackPointCompensationEnables black point compensation in the ICC transform
SeparationPlateName of the separation plate to isolate; empty renders normally

Usage notes

Related APIs