THotPDF Loaded Form Field Editing Methods
Uppdaterar fältvillkor och widgetutseendeordlistor i en befintlig AcroForm medan korrektheten för inkrementell sparning och renderingscache bevaras
Metoder på fältnivå
procedure SetLoadedFormFieldFlags(FieldIndex, AFlags: Integer);
procedure SetLoadedFormFieldMaxLength(FieldIndex, AMaxLength: Integer);
procedure SetLoadedFormFieldJustification(FieldIndex: Integer;
AJustification: THPDFFormFieldJustification);
procedure SetLoadedFormFieldTooltip(FieldIndex: Integer; const ATooltip: AnsiString);
SetLoadedFormFieldFlagsersätter hela PDF/FfbitmaskenSetLoadedFormFieldMaxLengthskriver/MaxLen; noll eller ett negativt värde tar bort gränsenTHPDFFormFieldJustificationinnehållerffjLeft,ffjCenterochffjRightför PDF/Qvärdena 0 till 2
Widgetgeometri
function GetLoadedFormFieldWidgetCount(FieldIndex: Integer): Integer;
function GetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
out ARect: THPDFRect): boolean;
procedure SetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
X1, Y1, X2, Y2: Single);
- Fält- och widgetindex är nollbaserade
- Widgetuppräkning exponerar varje
/Kids-post i radiogrupper och andra fält med flera widgetar - Rektangeländpunkter använder råa PDF-användaryta punkter och normaliseras innan de skrivs
Widgetutseende och synlighet
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);
- Rotation accepterar positiva eller negativa multipler av 90 grader och lagrar det normaliserade
/MK /Rvärdet - RGB-komponenter för ram och bakgrund begränsas till PDF:s DeviceRGB-intervall från 0 till 1
- Utseende- och synlighetsregistrerare uppdaterar varje widget som hör till det valda fältet
- Synligheten bevarar orelaterade annoteringsflaggor medan den styr Hidden, NoView och Print
Beteende vid inkrementell uppdatering
- Fält-, widget-
/MKoch/BS-ordlistor markeras som smutsiga på den nivå där respektive värde lagras - Visuella ändringar ogiltigförklarar bara den berörda sidans cachade DPI-varianter
- Ogiltiga fält- eller widgetindex lämnar dokumentet oförändrat
Exempel
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');
Relaterade API:er
Loaded form field methods · Loaded document toolkit · THotPDF