THotPDF Loaded Form Field Editing Métodos
Actualiza restricciones de campo y apariencia de widgets en un AcroForm existente
Métodos a nivel de campo
procedure SetLoadedFormFieldFlags(FieldIndex, AFlags: Integer);
procedure SetLoadedFormFieldMaxLength(FieldIndex, AMaxLength: Integer);
procedure SetLoadedFormFieldJustification(FieldIndex: Integer;
AJustification: THPDFFormFieldJustification);
procedure SetLoadedFormFieldTooltip(FieldIndex: Integer; const ATooltip: AnsiString);
SetLoadedFormFieldFlagsreemplaza la máscara de bits PDF/FfcompletaSetLoadedFormFieldMaxLengthescribe/MaxLen; un valor cero o negativo elimina el límiteTHPDFFormFieldJustificationcontieneffjLeft,ffjCenteryffjRightpara los valores/Qde PDF del 0 al 2
Geometría de widgets
function GetLoadedFormFieldWidgetCount(FieldIndex: Integer): Integer;
function GetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
out ARect: THPDFRect): boolean;
procedure SetLoadedFormFieldWidgetRect(FieldIndex, WidgetIndex: Integer;
X1, Y1, X2, Y2: Single);
- Los índices de campos y widgets están basados en cero
- La enumeración de widgets expone cada entrada
/Kidsde los grupos de radio y de los demás campos multi-widget - Los extremos del rectángulo usan puntos PDF sin procesar del espacio de usuario y se normalizan antes de escribirse
Apariencia y visibilidad de widgets
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);
- La rotación acepta múltiplos positivos o negativos de 90 grados y almacena el valor
/MK /Rnormalizado - Los componentes RGB del borde y del fondo se acotan al rango DeviceRGB de PDF, de 0 a 1
- Los setters de apariencia y visibilidad actualizan cada widget perteneciente al campo seleccionado
- La visibilidad conserva los flags de anotación no relacionados mientras controla Hidden, NoView y Print
Comportamiento de actualización incremental
- Los diccionarios de campo, widget,
/MKy/BSse marcan como sucios en el nivel donde se almacena cada valor - Los cambios visuales invalidan únicamente las variantes DPI en caché de la página afectada
- Los índices de campo o widget inválidos dejan el documento sin cambios
Ejemplo
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');
APIs relacionadas
Loaded form field methods · Loaded document toolkit · THotPDF