THotPDF Loaded Form Field Editing Methods
このページでは、読み込んだ PDF 文書内の注釈、リンク、フォームフィールドを確認または編集するための HotPDF API について説明します
宣言
procedure SetLoadedFormFieldFlags(FieldIndex, AFlags: Integer);
procedure SetLoadedFormFieldMaxLength(FieldIndex, AMaxLength: Integer);
procedure SetLoadedFormFieldJustification(FieldIndex: Integer;
AJustification: THPDFFormFieldJustification);
procedure SetLoadedFormFieldTooltip(FieldIndex: Integer; const ATooltip: AnsiString);
SetLoadedFormFieldFlagsは PDF の/Ffビットマスク全体を置き換えますSetLoadedFormFieldMaxLengthは/MaxLenを書き込みます。0 または負の値で制限を解除しますTHPDFFormFieldJustificationには、PDF/Q値 0〜2 に対応するffjLeft・ffjCenter・ffjRightが含まれます
概要
function GetLoadedFormFieldWidgetCount(FieldIndex: Integer): Integer;
function GetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
out ARect: THPDFRect): boolean;
procedure SetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
X1, Y1, X2, Y2: Single);
- フィールドインデックスとウィジェットインデックスはゼロベースです
- ウィジェット列挙は、ラジオグループや他のマルチウィジェットフィールドのすべての
/Kidsエントリを公開します - 矩形の端点は生の PDF ユーザー空間ポイントを使い、書き込み前に正規化されます
ウィジェットの外観と可視性
procedure SetLoadedFormFieldRotation(FieldIndex, ADegrees: Integer);
procedure SetLoadedFormFieldBorderColor(FieldIndex: Integer;
ARed, AGreen, ABlue: Single);
procedure SetLoadedFormFieldVisibility(FieldIndex: Integer;
AVisible, APrintable: boolean);
procedure SetLoadedFormFieldBorderWidth(FieldIndex: Integer; AWidth: Single);
procedure SetLoadedFormFieldBackgroundColor(FieldIndex: Integer;
ARed, AGreen, ABlue: Single);
- 回転は 90 度の正負の倍数を受け入れ、正規化された
/MK /R値を保存します - 罫線と背景の RGB コンポーネントは、PDF DeviceRGB の 0〜1 の範囲にクランプされます
- 外観と可視性のセッターは、選択されたフィールドに属するすべてのウィジェットを更新します
- 可視性の設定は、Hidden・NoView・Print を制御しつつ、無関係な注釈フラグを保持します
インクリメンタル更新の動作
- フィールド・ウィジェット・
/MK・/BSの各ディクショナリは、それぞれの値が保存されるレベルでダーティとしてマークされます - 視覚的な変更は、影響を受けたページのキャッシュ済み DPI バリアントだけを無効化します
- 無効なフィールドインデックスやウィジェットインデックスの場合、ドキュメントは変更されません
例
PDF.BeginIncrementalUpdate('input.pdf');
PDF.SetLoadedFormFieldMaxLength(0, 40);
PDF.SetLoadedFormFieldJustification(0, ffjCenter);
PDF.SetLoadedFormFieldRotation(0, 90);
PDF.SetLoadedFormFieldBorderColor(0, 0.1, 0.4, 0.8);
PDF.SetLoadedFormFieldWidgetRect(1, 1, 80, 150, 100, 170);
PDF.SaveIncrementalUpdate('updated.pdf');
関連 API
ホーム · 目次 · Loaded Documents · THotPDF · Loaded form field methods · Loaded document toolkit · THotPDF