DynaPDF Manual - Page 475

Previous Page 474   Index   Next Page 476

Function Reference
Page 475 of 839
TPDFFieldEx f;
pdfEditPage(PDF, 1);
// Initialize the structure size
f.StructSize = sizeof(f);
// GetPageAnnotCount() returns the number of all annotations, incl.
// form fields!
count = pdfGetPageAnnotCount(PDF);
for (i = 0; i < count; i++)
{
// GetPageFieldEx() simply returns false if a non-widget annotation
// is stored at an array index. The function does also not raise an
// exception in this case if the flag PDF_ANNOT_INDEX is set.
// So, there is no need to check the annotation type beforehand.
if (pdfGetPageFieldEx(i | PDF_ANNOT_INDEX, &f))
{
// do something with the data
}
}
pdfEndPage(PDF);
The old way to enumerate the fields from 0 to GetPageFieldCount() -1 does still work but it is slower
because the function must find every field in the array.
See also GetFieldEx().
Return values:
If the function succeeds the return value 1 and the structure Field is filled with values. If the function
fails the return value is 0.
GetPageHeight
Syntax:
double pdfGetPageHeight(
const PPDF* IPDF) // Instance pointer
The function returns the height of the currently open page. If no open page can be detected the
return value is the default height which will be used for newly created pages. The page height refers
to the media box of a page. The real size is maybe smaller if a crop box is present. The crop takes
precedence because it crops the media box.
If SetUseVisibleCoords() was set to true, the function checks whether a cop box is present and
returns the size of this box if set. A PDF unit represents 1/72 inch. See also GetBBox().
 

Previous topic: GetPageFieldCount, GetPageFieldEx

Next topic: GetPageLabel