DynaPDF Manual - Page 323

Previous Page 322   Index   Next Page 324

Function Reference
Page 323 of 777
CloseAndSignFileExt() must be called prior this function can be called.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
FlattenAnnotOrField
Syntax:
LBOOL pdfFlattenAnnotOrField(
const PPDF* IPDF,
// Instance pointer
UI32 Index,
// Annotation index
TAnnotFlattenFlags Flags) // See FlattenAnnots()
The function draws an annotation or form field on the current open page. Form fields are
annotations of type atWidget. The annotations of a page can be enumerated with GetPageAnnotEx()
/ GetPageAnnotCount().
The annotation or form field is deleted from the page's annotation array after it was flattened.
Remarks:
Annotations and form fields are stored in the same array but handled differently depending on the
function that is used to enumerate them. GetPageFieldEx() / GetPageFieldCount() use a pseudo
indexing scheme by skipping regular annotations between form fields (Widget Annotations).
In order to access a form field with GetPageField() or GetPageFieldEx(), the function must be
informed that an annotation index is passed to the function. This can be achieved by combining the
array index with the flag PDF_ANNOT_INDEX as follows (i represents the array index):
C/C++: pdfGetPageFieldEx(pdf, i | PDF_ANNOT_INDEX, &f);
VB 6:
Call pdf.GetPageFieldEx(i Or PDF_ANNOT_INDEX, f)
VB .Net: pdf.GetPageFieldEx(i Or CPDF.PDF_ANNOT_INDEX, f)
C#:
pdf.GetPageFieldEx(Convert.ToInt32(i | CPDF.PDF_ANNOT_INDEX), ref f);
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
FlattenAnnots
Syntax:
SI32 pdfFlattenAnnots(
const PPDF* IPDF,
// Instance pointer
TAnnotFlattenFlags Flags) // See below
typedef UI32 TAnnotFlattenFlags;
#define affNone
0x00000000 // Printable annotations
#define affUseViewState
0x00000001 // Visible annotations
#define affMarkupAnnots
0x00000002 // Markup annotations only
#define affNonPDFA_1
0x00000004 // Flatten annotations which are unsupported in PDF/A 1.
#define affNonPDFA_2
0x00000008 // Flatten annotations which are unsupported in PDF/A 2/3.
#define affFormFields
0x00000010 // If set, form fields will be flattened too.
#define affUseFieldViewState
0x00000020 // Meaningful only if affFormFields is set. If set, flatten
// the view state of form fields. Use the print state
 

Previous topic: FindLinkAnnot, FindNextBookmark, FinishSignature

Next topic: FlattenForm