DynaPDF Manual - Page 512

Previous Page 511   Index   Next Page 513

Function Reference
Page 512 of 839
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: GetUseTransparency, GetUseVisibleCoords, GetViewerPreferences

Next topic: GetWMFDefExtent, GetWMFPixelPerInch, GetWordSpacing