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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.12 pCOS Functions<br />

The full pCOS syntax for retrieving object data from a PDF is supported. For a detailed<br />

description please refer to the pCOS Path Reference which is available as a separate document.<br />

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

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

Perl PHP float pcos_get_number(int doc, string path)<br />

VB RB 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++ wstring pcos_get_string(int doc, wstring path)<br />

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

Perl PHP string pcos_get_string(int doc, string path)<br />

VB RB 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, number, 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 raises an exception if pCOS does not run in full mode and the type of the<br />

object is string. However, the objects /Info/* (document info keys) can also be retrieved in<br />

188 Chapter 10: <strong>TET</strong> Library API Reference

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

Saved successfully!

Ooh no, something went wrong!