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.

tet/3.0/resource<br />

/tet/3.0/resource/cmap<br />

On MVS the searchpath feature is not supported.<br />

Searching for the UPR resource file. If resource files are to be used you can specify<br />

them via calls to <strong>TET</strong>_set_option( ) (see below) or in a UPR resource file. <strong>TET</strong> reads this file<br />

automatically when the first resource is requested. The detailed process is as follows:<br />

> If the environment variable <strong>TET</strong>RESOURCEFILE is defined <strong>TET</strong> takes its value as the<br />

name of the UPR file to be read. If this file cannot be read an exception will be<br />

thrown.<br />

> If the environment variable <strong>TET</strong>RESOURCEFILE is not defined, <strong>TET</strong> tries to open a file<br />

with the following name:<br />

upr (on MVS; a dataset is expected)<br />

/tet/3.0/tet.upr (on iSeries)<br />

tet.upr (Windows, Unix, and all other systems)<br />

If this file cannot be read no exception will be thrown.<br />

> On Windows <strong>TET</strong> will additionally try to read the following registry entry:<br />

HKLM\SOFTWARE\<strong>PDFlib</strong>\<strong>TET</strong>\3.0\resourcefile<br />

The value of this key (which will be created with the value /tet.upr by the<br />

<strong>TET</strong> installer, but can also be created by other means) will be taken as the name of the<br />

resource file to be used. If this file cannot be read an exception will be thrown.<br />

> The client can force <strong>TET</strong> to read a resource file at runtime by explicitly setting the<br />

resourcefile option:<br />

<strong>TET</strong>_set_option(tet, "resourcefile=/path/to/tet.upr");<br />

This call can be repeated arbitrarily often; the resource entries will be accumulated.<br />

Configuring resources at runtime. In addition to using a UPR file for the configuration,<br />

it is also possible to directly configure individual resources at runtime via <strong>TET</strong>_set_<br />

option( ). This function takes a resource category name and pairs of corresponding resource<br />

names and values as it would appear in the respective section of this category in<br />

a UPR resource file, for example:<br />

<strong>TET</strong>_set_option(tet, "glyphlist={myglyphnames=/usr/local/glyphnames.gl}");<br />

Multiple resource names can be configured in a single option list for a resource category<br />

option (but the same resource category option cannot be repeated in a single call to <strong>TET</strong>_<br />

set_option( )). Alternatively, multiple calls can be used to accumulate resource settings.<br />

Escape sequences for text files. Escape sequences are supported in all text files except<br />

UPR files and CMap files. Special character sequences can be used to include unprintable<br />

characters in text files. All sequences start with a backslash ’\’ character:<br />

> \x introduces a sequence of two hexadecimal digits (0-9, A-F, a-f), e.g. \x0D<br />

> \nnn denotes a sequence of three octal digits (0-7), e.g. \015. The sequence \000 will be<br />

ignored.<br />

> The sequence \\ denotes a single backslash.<br />

> A backslash at the end of a line will cancel the end-of-line character.<br />

5.2 Resource Configuration and File Searching 53

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

Saved successfully!

Ooh no, something went wrong!