RemoveFormFieldByName

Form fields

Description

Deletes a form field by its fully-qualified name. The name is resolved to a 1-based field index, and the field is removed from the AcroForm tree and released from its page

When several fields share the same name, the first match in the field collection is deleted; repeat the call until it returns 0 to strip all fields carrying that name

Syntax

Delphi

Function TPDFlib.RemoveFormFieldByName(Const FieldName: WideString): Integer;

Parameters

FieldNameFully-qualified name of the field to delete

Return values

1A field matching FieldName was found and deleted
0No field matches FieldName or the document has no form data

Remarks

Name-driven convenience wrapper around FindFormFieldByTitle and DeleteFormField; call those directly when you already hold the field index

See also

DeleteFormField, FindFormFieldByTitle, RemoveFormFieldCalcOrder, RenameFormField