Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 460

Previous Page 459   Index   Next Page 461

Function Reference
Page 460 of 750
LBOOL pdfGetViewport(
const PPDF* IPDF,
// Instance pointer
UI32 PageNum,
// Page number
UI32 Index,
// Viewport index
struct TPDFViewport* VP) // See below
struct TPDFViewport
StructSize; // Must be set to sizeof(TPDFViewport)
// Bounding box
// Optional -> GetMeasureObj()
const char* NameA;
// Optional name
const UI16* NameW;
// Optional name
// Pointer of a Point Data dictionary -> GetPtDataObj().
The functions returns a viewport that is associated with a page. A viewport is a rectangular region of
a page, that specifies usually a measure coordinate system or points in a geospatical coordinate
Since viewports might overlap, to determine the viewport to use for any point on a page, the
viewports in the array shall be examined, starting with the last one and iterating in reverse, and the
first one whose BBox entry contains the point shall be chosen.
The member StructSize must be set to sizeof(TPDFViewport) before the function can be called. To
determine the number of viewports associated with a page call GetViewportCount().
To determine how viewports and measure dictionaries can be used, please have a look into the PDF
Reference 2.0, ISO/DIS 32000-2, Section Measurement properties.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SI32 pdfGetViewportCount(
const PPDF* IPDF, // Instance pointer
UI32 PageNum)
// Page number
The function returns the number of viewports which are associated with a page. The first page has
the page number 1.
Return values:
If the function succeeds the return value is the number of viewports, a number greater or equal zero.
If the function fails the return value is a negative error code. The function can only fail if the page
number is invalid.

Previous topic: GetViewerPreferences

Next topic: GetWordSpacing