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.

Returns<br />

Scope<br />

Bindings<br />

The converted UTF-16 string. The returned string is valid until the next call to any function<br />

other than <strong>TET</strong>_utf16_to_utf8( ), <strong>TET</strong>_utf8_to_utf16( ), or <strong>TET</strong>_utf32_to_utf16( ) or until<br />

an exception is thrown. Clients must copy the string if they need it longer.<br />

any<br />

This function is not available in Unicode-capable language bindings.<br />

C++ void create_pvf(string filename, const void *data, size_t size, string optlist)<br />

C# Java void create_pvf(String filename, byte[] data, String optlist)<br />

Perl PHP <strong>TET</strong>_create_pvf(resource tet, string filename, string data, string optlist)<br />

VB Sub create_pvf(filename As String, data, optlist As String)<br />

C void <strong>TET</strong>_create_pvf(<strong>TET</strong> *tet,<br />

const char *filename, int len, const void *data, size_t size, const char *optlist)<br />

Create a named virtual read-only file from data provided in memory.<br />

filename (Name string) The name of the virtual file. This is an arbitrary string which<br />

can later be used to refer to the virtual file in other <strong>TET</strong> calls.<br />

len (C language binding only) Length of filename (in bytes) for UTF-16 strings. If len=0<br />

a null-terminated string must be provided.<br />

data A reference to the data for the virtual file. In COM this is a variant of byte containing<br />

the data comprising the virtual file. In C and C++ this is a pointer to a memory<br />

location. In Java this is a byte array. In Perl and PHP this is a string.<br />

size<br />

(C and C++ only) The length in bytes of the memory block containing the data.<br />

optlist<br />

An option list according to Table 10.2. The following option can be used: copy<br />

Details<br />

The virtual file name can be supplied to any API function which uses input files. Some<br />

of these functions may set a lock on the virtual file until the data is no longer needed.<br />

Virtual files will be kept in memory until they are deleted explicitly with <strong>TET</strong>_delete_<br />

pvf( ), or automatically in <strong>TET</strong>_delete( ).<br />

Each <strong>TET</strong> object will maintain its own set of PVF files. Virtual files cannot be shared<br />

among different <strong>TET</strong> objects. Multiple threads working with separate <strong>TET</strong> objects do not<br />

need to synchronize PVF use. If filename refers to an existing virtual file an exception<br />

will be thrown. This function does not check whether filename is already in use for a regular<br />

disk file.<br />

Unless the copy option has been supplied, the caller must not modify or free (delete)<br />

the supplied data before a corresponding successful call to <strong>TET</strong>_delete_pvf( ). Not obeying<br />

to this rule will most likely result in a crash.<br />

Table 10.2 Options for <strong>TET</strong>_create_pvf( )<br />

option<br />

copy<br />

description<br />

(Boolean) <strong>TET</strong> will immediately create an internal copy of the supplied data. In this case the caller may<br />

dispose of the supplied data immediately after this call. The copy option will automatically be set to true<br />

in the COM, .NET, and Java bindings (default for other bindings: false). In other language bindings the<br />

data will not be copied unless the copy option is supplied.<br />

10.2 General Functions 125

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

Saved successfully!

Ooh no, something went wrong!