รีเคิร์ด THPDFRenderDocAccess

ผูกตัวเรนเดอร์เข้ากับบริการของเอกสาร สำหรับ resolve reference, อ่าน stream, decode รูปภาพ, หาฟอนต์ และประเมินความมองเห็นของ layer

การประกาศ

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;

ยูนิต

HPDFPageRenderer

ฟิลด์

ฟิลด์วัตถุประสงค์
Contextcontext pointer ที่ผู้เรียกส่งมา ถูกส่งเป็นอาร์กิวเมนต์ตัวแรกของ callback ทุกตัว เอกสารจะผูกตัวเองไว้ตรงนี้
SharedCacheแคชของตัวเรนเดอร์ที่หลายหน้าแชร์กันได้เมื่อเปิด ShareRenderCaches
ShareRenderCachestrue เมื่อเอกสารยอมให้ตัวเรนเดอร์หลายตัวที่ทำงานพร้อมกันแชร์ decode cache
ResolveObjectตัว resolve indirect reference แบบทั่วไปสำหรับ object ทุกชนิด เพิ่มเข้ามาเพราะ resolver แบบระบุชนิดจะคืน nil เมื่อชนิดไม่ตรง
ResolveDictionaryresolve indirect reference ไปยัง dictionary object ชนิดอื่นจะได้ nil
ResolveStreamresolve indirect reference ไปยัง stream object
ReadDecodedStreamBytesอ่าน stream แบบถอดการเข้ารหัสครบแล้วเป็น byte array
AcquireDecodedImageStreamdecode image XObject เป็น bitmap handle แบบแชร์ร่วมนับ reference
DecodeImageStreamdecode image XObject เป็น bitmap ที่ผู้เรียกเป็นเจ้าของ
BeginProgressiveImageDecodeเริ่ม progressive decoder ที่ยกเลิกได้ สำหรับ stream รูปภาพขนาดใหญ่
DecodeImageRegiondecode บางส่วนของรูปภาพที่ขนาดพิกเซลตามที่ขอ
AcquireDecodedImageRegionเวอร์ชันย่อยส่วนของรูปที่คืน bitmap handle แบบแชร์ร่วมนับ reference
DecodeInlineImagedecode inline image จากไบต์ ID..EI ดิบ ๆ กับชุด key BI ที่ normalize แล้ว โดยไม่ผ่านแคชตามหมายเลข object ถ้า hook เป็น nil แปลว่า inline image จะไม่ถูกวาด
DecodeColorKeyMaskเปลี่ยน array color-key /Mask ของ image XObject ให้เป็น soft mask ขาวดำขนาดเท่ากับภาพ ได้ nil เมื่อภาพไม่มี color-key mask ที่ใช้ได้ และ hook ที่เป็น nil จะวาดภาพแบบนี้โดยไม่ใส่ mask
ResolveFontDictหา font dictionary จาก resource key โดยไล่ indirect reference ทั้งระดับ /Resources และ /Font ไม่เจอจะได้ nil
EvalOCVisibilityประเมิน object property /OC เทียบกับสถานะ layer ของเอกสาร ถ้า hook เป็น nil หรือผลเป็น True แปลว่าเนื้อหาถูกวาด
CancellationTokencancellation token ที่ถูกเช็กระหว่างการ decode ที่ยาวนาน
ColourIntentintent การจัดการสีที่ใช้กับ graphics state ของผลเรนเดอร์
FallbackPolicyเลือกว่าฟีเจอร์ที่ไม่รองรับจะถูกมองข้าม, รายงาน หรือถือเป็นความล้มเหลวแบบเข้ม
FallbackDiagnosticLimitจำกัดจำนวนข้อความวินิจฉัยที่เก็บไว้ระหว่าง fallback
OverprintPreviewเปิดการจำลอง overprint preview
ProofICCProfileไบต์ ICC profile ที่ใช้ฝั่ง proofing ของ pipeline สี
OutputICCProfileไบต์ ICC profile ที่บรรยายอุปกรณ์ output
BlackPointCompensationเปิด black point compensation ในการแปลง ICC
SeparationPlateชื่อ separation plate ที่จะแยกดู ปล่อยว่างจะเรนเดอร์ตามปกติ

หมายเหตุการใช้งาน

API ที่เกี่ยวข้อง