THPDFRenderDocAccess Record

Binds the renderer to document services for resolving references, reading streams, decoding images, locating fonts and assessing 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 each callback; the document binds itself here
SharedCacheRenderer cache that several pages can share where ShareRenderCaches is enabled
ShareRenderCachesTrue where the document lets concurrent renderers share decode caches
ResolveObjectGeneric indirect-reference resolver for any object type; added because the typed resolvers hand back nil for non-matching types
ResolveDictionaryResolves an indirect reference to a dictionary object, nil for any other type
ResolveStreamResolves an indirect reference that points at a stream object
ReadDecodedStreamBytesReads a stream, fully decoded, into a byte array
AcquireDecodedImageStreamDecodes an image XObject into a reference-counted bitmap handle that can be shared
DecodeImageStreamDecodes an image XObject into a bitmap the caller owns
BeginProgressiveImageDecodeOpens a cancellable progressive decoder for a large image stream
DecodeImageRegionDecodes a sub-region of an image at the requested pixel size
AcquireDecodedImageRegionRegion variant handing back a shared, reference-counted bitmap handle
DecodeInlineImageDecodes an inline image from raw ID..EI bytes and the normalised BI key set, bypassing the object-number cache; a nil hook means inline images are not rendered
DecodeColorKeyMaskTurns the colour-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 colour-key mask, and a nil hook draws such images unmasked
ResolveFontDictLooks a font dictionary up by resource key, following indirect references at the /Resources and /Font levels; nil where absent
EvalOCVisibilityEvaluates an /OC property object against the document layer states; a nil hook or a True result means the content is drawn
CancellationTokenCancellation token checked whilst long decode operations run
ColourIntentColour handling intent applied to the graphics state as rendered
FallbackPolicySelects whether unsupported features are ignored, reported or treated as strict failures
FallbackDiagnosticLimitCaps the number of diagnostic messages collected whilst falling back
OverprintPreviewSwitches on overprint preview simulation
ProofICCProfileICC profile bytes used on the proofing side of the colour pipeline
OutputICCProfileICC profile bytes that describe the output device
BlackPointCompensationSwitches on black point compensation in the ICC transform
SeparationPlateName of the separation plate to isolate; empty means normal rendering

Usage notes

Related APIs