DynaPDF Manual - Page 324

Previous Page 323   Index   Next Page 325

Function Reference
Page 324 of 777
// otherwise.
#define affSigFields
0x00000040 // Meaningful only if affFormFields is not set. If set,
// signed signature fields will be flattened.
#define affKeepLinkAnnots
0x00001000 // If set, link annotations will be kept.
#define affKeepFileAttach
0x00002000 // If set, file attachment annotations will be kept.
#define affKeepTextAnnots
0x00004000 // If set, text annotations will be kept.
#define affPreserveZOrder
0x00400000 // If set, preserve the z-order under any curcumstances. That
// means visible overlapping annotations or form fields will
// be flattened, regardless the type.
#define affKeepEmptySigFields 0x00008000 // If set, signature fields which are not already signed will
// be kept.
The function draws annotations and optionally form fields on the corresponding pages and deletes
the annotations when finish. The flatten flags can be combined. The flag affMarkupAnnots causes that
non-markup annotations will be left intact (all kinds of 3D, link, and sound annotations, for
example).
The function is able to create appearance streams for most annotation types but not all. Missing
appearance streams of 3D, Movie, RichMedia, Redact, PrinterMark, Projection, and Screen
annotations cannot be created on demand.
If form fields should be flattened too then it is usually best to flatten the print state (default) since
push puttons, for example, are usually excluded from printing.
Return values:
If the function succeeds the return value is the number of annotations which are still in memory. If
the function fails the return value is a negative error code.
FlattenForm
Syntax:
SI32 pdfFlattenForm(
const PPDF* IPDF) // Instance pointer
The function draws all form fields on the corresponding pages and deletes the form fields, incl.
corresponding JavaScripts and JavaScript actions. The resulting PDF pages look after flattening as if
the form were printed.
Note that this function does not support XFA forms. If the form is a hybrid form, the PDF form fields
will be flattened. A maybe existing XFA form will be deleted but not flattened.
Fields, which are invisible for printing, due to an absent print flag, or if the hidden flag was set, are
excluded from flattening. These fields are deleted without drawing them on the page.
This function is especially useful if a large amount of Interactive Forms (which are already filled out
by the user) should be prepared for printing, or if the forms should be archived without allowing
further changes. Flattened forms require less disk space and can be printed faster.
Annotations and form fields can be flattened with FlattenAnnots(). This function preserves also the
z-order of annotations and form fields. This is not possible when flatting form fields and annotations
separetly.
 

Previous topic: FlattenAnnotOrField, FlattenAnnots

Next topic: FlushPageContent, FlushPages