17.05.2014 Views

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.10 pCOS Functions<br />

The full pCOS syntax for retrieving object data from a PDF is supported; see Chapter 9,<br />

»The pCOS Interface«, page 105 for a detailed description.<br />

C++ double pcos_get_number(int doc, string path)<br />

C# Java double pcos_get_number(int doc, String path)<br />

Perl PHP float <strong>TET</strong>_pcos_get_number(resource tet, int doc, String path)<br />

VB Function pcos_get_number(doc as Long, path As String) As Double<br />

C double <strong>TET</strong>_pcos_get_number(<strong>TET</strong> *tet, int doc, const char *path, ...)<br />

Get the value of a pCOS path with type number or boolean.<br />

doc A valid document handle obtained with <strong>TET</strong>_open_document*( ).<br />

path<br />

A full pCOS path for a numerical or boolean object.<br />

Additional parameters (C language binding only) A variable number of additional parameters<br />

can be supplied if the key parameter contains corresponding placeholders (%s<br />

for strings or %d for integers; use %% for a single percent sign). Using these parameters<br />

will save you from explicitly formatting complex paths containing variable numerical<br />

or string values. The client is responsible for making sure that the number and type of<br />

the placeholders matches the supplied additional parameters.<br />

Returns<br />

The numerical value of the object identified by the pCOS path. For Boolean values 1 will<br />

be returned if they are true, and 0 otherwise.<br />

C++ string pcos_get_string(int doc, string path)<br />

C# Java String pcos_get_string(int doc, String path)<br />

Perl PHP String <strong>TET</strong>_pcos_get_string(resource tet, int doc, String path)<br />

VB Function pcos_get_string(doc as Long, path As String) As String<br />

C const char *<strong>TET</strong>_pcos_get_string(<strong>TET</strong> *tet, int doc, const char *path, ...)<br />

Get the value of a pCOS path with type name, string, or boolean.<br />

doc A valid document handle obtained with <strong>TET</strong>_open_document*( ).<br />

path<br />

A full pCOS path for a string, name, or boolean object.<br />

Additional parameters (C language binding only) A variable number of additional parameters<br />

can be supplied if the key parameter contains corresponding placeholders (%s<br />

for strings or %d for integers; use %% for a single percent sign). Using these parameters<br />

will save you from explicitly formatting complex paths containing variable numerical<br />

or string values. The client is responsible for making sure that the number and type of<br />

the placeholders matches the supplied additional parameters.<br />

Returns<br />

Details<br />

A string with the value of the object identified by the pCOS path. For Boolean values the<br />

strings true or false will be returned.<br />

This function will raise an exception if pCOS does not run in full mode and the type of<br />

the object is string (see Section 9.6, »Encrypted PDF Documents«, page 119). As an exception,<br />

the objects /Info/* (document info keys) can also be retrieved in restricted pCOS<br />

10.10 pCOS Functions 153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!