THPDFRenderDocAccess レコード
参照の解決、ストリームの読み出し、画像のデコード、フォントの特定、レイヤー可視性の評価のために、レンダラーをドキュメントサービスへ結び付けます
宣言
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 | 呼び出し側が用意するコンテキストポインタ。全コールバックの第 1 引数として渡され、ドキュメントがここに自身を結び付けます |
SharedCache | ShareRenderCaches 有効時に複数ページで共有できるレンダラーキャッシュ |
ShareRenderCaches | ドキュメントが、並行動作するレンダラー間でのデコードキャッシュ共有を許すとき True |
ResolveObject | 任意のオブジェクト型に使える汎用の間接参照リゾルバ。型付きリゾルバは一致しない型に対して nil を返すため、追加されました |
ResolveDictionary | ディクショナリオブジェクトへの間接参照を解決します。他の型は nil |
ResolveStream | ストリームオブジェクトへの間接参照を解決します |
ReadDecodedStreamBytes | ストリームを完全にデコードしてバイト配列へ読み込みます |
AcquireDecodedImageStream | 画像 XObject を、共有の参照カウント付きビットマップハンドルへデコードします |
DecodeImageStream | 画像 XObject を、呼び出し側が所有するビットマップへデコードします |
BeginProgressiveImageDecode | 大きな画像ストリーム用の、キャンセル可能なプログレッシブデコーダを開始します |
DecodeImageRegion | 画像の部分領域を、要求されたピクセルサイズでデコードします |
AcquireDecodedImageRegion | 領域版。共有の参照カウント付きビットマップハンドルを返します |
DecodeInlineImage | 生の ID..EI バイトと正規化済み BI キー集合からインライン画像をデコードします。オブジェクト番号キャッシュは経由しません。フックが nil の場合、インライン画像は描画されません |
DecodeColorKeyMask | 画像 XObject のカラーキー /Mask 配列を、画像と同じサイズの白黒ソフトマスクに変換します。画像に使えるカラーキーマスクがない場合は nil。フックが nil の場合、そのような画像はマスクなしで描画されます |
ResolveFontDict | リソースキーでフォントディクショナリを検索します。/Resources と /Font の両レベルで間接参照を辿ります。なければ nil |
EvalOCVisibility | /OC プロパティオブジェクトをドキュメントのレイヤー状態に対して評価します。フックが nil、または結果が True の場合、コンテンツは描画されます |
CancellationToken | 長時間のデコード処理中にチェックされるキャンセルトークン |
ColourIntent | 描画されるグラフィックス状態に適用されるカラー処理インテント |
FallbackPolicy | 未対応の機能を無視するか、報告するか、厳格な失敗として扱うかを選択します |
FallbackDiagnosticLimit | フォールバック中に収集される診断メッセージ数の上限 |
OverprintPreview | オーバープリントプレビューのシミュレーションを有効にします |
ProofICCProfile | カラーパイプラインの校正(プルーフ)側に使う ICC プロファイルのバイト列 |
OutputICCProfile | 出力デバイスを記述する ICC プロファイルのバイト列 |
BlackPointCompensation | ICC 変換で黒点補償を有効にします |
SeparationPlate | 切り出す分版プレートの名前。空なら通常どおりに描画します |
使用上の注意
- THotPDF はすべてのフックを内部の
MakeRenderDocAccessヘルパーで結び付けるため、アプリケーションはレコードを埋める代わりに完成済みのものを受け取ります - カスタムレンダーバックエンドは、ドキュメントに直接アクセスする代わりに、
THPDFPageRenderBackendRequestからこれらのフックを読みます DecodeInlineImageかEvalOCVisibilityを nil のままにすると、インライン画像をスキップし任意コンテンツをすべて描画する従来の動作に戻ります