רקורד THPDFRenderDocAccess
קושר את ה-renderer אל שירותי המסמך לפתרון הפניות, קריאת streams, פענוח תמונות, איתור גופנים והערכת נראות שכבות
הצהרה
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
שדות
| שדה | מטרה |
|---|---|
Context | מצביע context שהקורא מספק ומועבר כארגומנט הראשון של כל callback; המסמך קושר את עצמו כאן |
SharedCache | מטמון renderer שכמה עמודים יכולים לשתף כש-ShareRenderCaches מופעל |
ShareRenderCaches | True כשהמסמך מאפשר ל-renderers מקבילים לשתף מטמוני פענוח |
ResolveObject | מפענח הפניות-עקיפות גנרי לכל סוג אובייקט; נוסף כי המפענחים הטיפוסיים מחזירים nil לטיפוסים שאינם תואמים |
ResolveDictionary | מפענח הפניה עקיפה אל אובייקט מילון, nil לטיפוסים אחרים |
ResolveStream | מפענח הפניה עקיפה אל אובייקט stream |
ReadDecodedStreamBytes | קורא stream מפוענח במלואו אל מערך בתים |
AcquireDecodedImageStream | מפענח XObject תמונה אל handle bitmap משותף עם ספירת הפניות |
DecodeImageStream | מפענח XObject תמונה אל bitmap בבעלות הקורא |
BeginProgressiveImageDecode | מתחיל מפענח פרוגרסיבי ניתן-לביטול עבור stream תמונה גדול |
DecodeImageRegion | מפענח תת-אזור של תמונה בגודל פיקסלים מבוקש |
AcquireDecodedImageRegion | וריאנט האזור שמחזיר handle bitmap משותף עם ספירת הפניות |
DecodeInlineImage | מפענח תמונת inline מבתי ה-ID..EI הגלמיים ומקבוצת המפתחות המנורמלת של ה-BI, תוך עקיפת מטמון מספרי-האובייקטים; hook nil אומר שתמונות inline אינן מרונדרות |
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 | מאתר מילון גופן לפי מפתח משאב, תוך מעקב אחרי הפניות עקיפות ברמות ה-/Resources וה-/Font; nil כשנעדר |
EvalOCVisibility | מעריך אובייקט מאפיין /OC מול מצבי השכבות של המסמך; hook nil או תוצאה True אומרים שהתוכן מצויר |
CancellationToken | token ביטול שנבדק בזמן פעולות פענוח ארוכות |
ColourIntent | כוונת טיפול בצבע שמוחלת על מצב הגרפיקה המרונדר |
FallbackPolicy | בוחר אם יכולות לא נתמכות מוזנחות, מדווחות או מתייחסות ככישלונות מחמירים |
FallbackDiagnosticLimit | תקרה על מספר הודעות האבחון שנאספות בזמן fallback |
OverprintPreview | מפעיל סימולציית preview של overprint |
ProofICCProfile | בתי פרופיל ICC לצד ה-proofing של pipeline הצבע |
OutputICCProfile | בתי פרופיל ICC שמתארים את התקן הפלט |
BlackPointCompensation | מפעיל פיצוי נקודה שחורה בטרנספורמציה של ICC |
SeparationPlate | שם לוח ההפרדה לבידוד; ריק מרנדר רגיל |
הערות שימוש
- THotPDF קושר כל hook דרך ה-helper הפנימי
MakeRenderDocAccess שלו, כך שהיישומים מקבלים רקורד מוכן במקום למלא אחד - backends רינדור מותאמים קוראים את ה-hooks האלה מ-
THPDFPageRenderBackendRequest במקום לגשת אל המסמך ישירות - השאירו את
DecodeInlineImage או את EvalOCVisibility כ-nil כדי לשחזר את התנהגות ה-legacy של דילוג על תמונות inline וציור כל התוכן האופציונלי