FlattenFormField

Form fields, Page layout

Description

Use this function to draw the visual appearance onto the page it is associated with. The form field will then be removed from the document and only it's appearance will remain - it will no longer be an interactive field.

If the field is flattened successfully the field index of subsequent form fields will be decreased by 1. This function does not updates the form field's appearance stream before flattening. To update the appearance stream before flattening, use the UpdateAndFlattenFormField function or call UpdateAppearanceStream followed by a call to this function.

Syntax

Delphi

Function TPDFlib.FlattenFormField(Index: Integer): Integer;

ActiveX

Function PDFlib::FlattenFormField(Index As Long) As Long

DLL

int DLFlattenFormField(int InstanceID, int Index);

Parameters

IndexThe index of the form field to work with. The first form field has an index of 1.

Return values

0The form field could not be found or it was not possible to flatten the form field
1The form field was flattened successfully

Remarks

The widget appearance is placed with the ISO 32000-2 §12.5.5 rule: the box its BBox covers after its Matrix is mapped onto the widget rectangle, so appearances with a nonzero BBox origin or a rotated widget (/MK /R) keep their position

A widget flagged Hidden or NoView flattens to nothing. When a field has no appearance, one is generated first; a field that holds a value but still has no appearance is kept and the method returns 0, instead of being removed with its value unseen