THotPDF Loaded Form Field Editing Methods
기존 AcroForm에서 필드 제약과 위젯 appearance 딕셔너리를 갱신하면서 증분 저장과 렌더 캐시 정합성을 지킵니다
필드 수준 메서드
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를 담습니다
Widget geometry
function GetLoadedFormFieldWidgetCount(FieldIndex: Integer): Integer;
function GetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
out ARect: THPDFRect): boolean;
procedure SetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
X1, Y1, X2, Y2: Single);
- 필드와 위젯 인덱스는 0 기반입니다
- 위젯 열거는 라디오 그룹과 기타 다중 위젯 필드의 모든
/Kids항목을 노출합니다 - 사각형 끝점은 raw PDF 사용자 공간 포인트를 쓰며 기록 전에 정규화됩니다
위젯 appearance와 표시 여부
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 구성 요소는 0~1의 PDF DeviceRGB 범위로 제한됩니다
- appearance/표시 setter는 선택된 필드에 속한 모든 위젯을 갱신합니다
- 표시 제어는 Hidden, NoView, Print를 다루면서 무관한 주석 플래그는 보존합니다
증분 업데이트 동작
- 필드, 위젯,
/MK,/BS딕셔너리는 각 값이 저장된 수준에서 dirty 표시됩니다 - 시각적 변경은 영향받은 페이지의 캐시 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');