PDFlib Text Extraction Toolkit (TET) Manual
PDFlib Text Extraction Toolkit (TET) Manual
PDFlib Text Extraction Toolkit (TET) Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
10.6.3 <strong>PDFlib</strong> Virtual Filesystem (PVF)<br />
C++ void create_pvf(wstring filename, const void *data, size_t size, wstring optlist)<br />
C# Java void create_pvf(String filename, byte[] data, String optlist)<br />
Perl PHP create_pvf(string filename, string data, string optlist)<br />
VB RB 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.3. 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.3 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 />
152 Chapter 10: <strong>TET</strong> Library API Reference