DynaPDF Manual - Page 266
Previous Page 265 Index Next Page 267
Function Reference
Page 266 of 839
CreateGeospatialMeasure
Syntax:
SI32 pdfCreateGeospatialMeasure(
const PPDF* IPDF,
// Instance pointer
UI32 Viewport,
// Viewport handle (required)
const char* Attributes) // JSON like string. See description
The function creates a geospatial measure dictionary. This kind of measure dictionary can be used to
convert PDF units to geographic coordinates.
A measure dictionary is used by the measure tool of Adobe's Acrobat and by other PDF viewers
which contain a PDF compatible measure tool.
Notice:
This is a low level function for more experienced users who are familiar with PDF. It is assumed
that a copy of the ISO Standard 32000-2 or newer is available by these users.
The parameter Viewport must contain a valid viewport handle that was created by CreateViewport().
The required parameter Attributes must be a JSON like string (Javascript Object Notation) that
contains the necessary parameters for the coordinate conversion. Please have a look at the section
JSON Parser to determine how JSON strings can be created and which extensions are supported.
The function creates a dictionary that contains already the keys /Type and /Subtype. These keys are
reserved and must not be present.
Notice:
It seems that Adobes Acrobat does not consider the key /PDU (Preferred Display Units), e.g.
/PDF[/KM/SQKM/DEG]. In all tests /PDU was ignored by Acrobat. It is not known when this
key will be considered or whether it is supported at all.
Please note that double quotes in a WKT string must be preceded by a backslash since double
quotes are a string terminator in JSON grammar.
Example JSON string:
In order to test this string copy it to a text file and load the file afterwards into a string object and
pass it to the function. Note that the string must be null-terminated. The same string defined as
C/C++ literal string would require more complicated escaping due to the double quotes in the WKT
string.
The example JSON string was created from this source file:
Previous topic: CreateExtGState
Next topic: CreateGoToAction
Web links on this page: