com.pdflib
Class pCOS

java.lang.Object
  extended by com.pdflib.pCOS

public final class pCOS
extends java.lang.Object

pCOS - PDF Information Retrieval Tool
Note that this is only a syntax summary. For complete information please refer to the pCOS API reference manual which is available in the PDF file pCOS-manual.pdf in the pCOS distribution.

Version:
3.0dev
Author:
PDFlib GmbH

Constructor Summary
pCOS()
          Create a new pCOS context.
 
Method Summary
 void close_document(int doc)
          Close a PDF document.
 void create_pvf(java.lang.String filename, byte[] data, java.lang.String optlist)
          Create a named virtual read-only file from data provided in memory.
 int delete_pvf(java.lang.String filename)
          Delete a named virtual file and free its data structures (but not the contents).
 void delete()
          Delete a pCOS context and release all its internal resources.
 java.lang.String get_apiname()
          Get the name of the API function which caused the last exception.
 java.lang.String get_errmsg()
          Get a detailed description of the last exception.
 int get_errnum()
          Return the error number of the last error.
 double get_number(int doc, java.lang.String path)
          Deprecated. Use pcos_get_number().
 byte[] get_stream(int doc, java.lang.String optlist, java.lang.String path)
          Deprecated. Use pcos_get_stream().
 java.lang.String get_string(int doc, java.lang.String path)
          Deprecated. Use pcos_get_string().
 int open_document_mem(byte[] data, java.lang.String optlist)
          Deprecated. Use create_pvf()/delete_pvf().
 int open_document(java.lang.String filename, java.lang.String optlist)
          Open a PDF document from file.
 double pcos_get_number(int doc, java.lang.String path)
          Get pCOS path value with numerical type.
 byte[] pcos_get_stream(int doc, java.lang.String optlist, java.lang.String path)
          Get pCOS stream object contents.
 java.lang.String pcos_get_string(int doc, java.lang.String path)
          Get pCOS path value with string type.
 void set_option(java.lang.String optlist)
          Set some options.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

pCOS

public pCOS()
     throws pCOSException
Create a new pCOS context.

Throws:
pCOSException - May throw an exception in case of memory shortage.
Method Detail

close_document

public final void close_document(int doc)
                          throws pCOSException
Close a PDF document.

Throws:
pCOSException - May throw an exception for various reasons.

create_pvf

public final void create_pvf(java.lang.String filename,
                             byte[] data,
                             java.lang.String optlist)
                      throws pCOSException
Create a named virtual read-only file from data provided in memory.

Throws:
pCOSException - PDF output cannot be finished after an exception.

delete

public final void delete()
Delete a pCOS context and release all its internal resources. This should be called for cleanup when processing is done, and after a pCOSException occurred. This method may also be called by the finalizer, but it is safe to issue multiple calls.


delete_pvf

public final int delete_pvf(java.lang.String filename)
                     throws pCOSException
Delete a named virtual file and free its data structures (but not the contents).

Returns:
-1 if the virtual file exists but is locked, and 1 otherwise.
Throws:
pCOSException

get_apiname

public final java.lang.String get_apiname()
                                   throws pCOSException
Get the name of the API function which caused the last exception.

Returns:
pCOSlib API function name
Throws:
pCOSException

get_errmsg

public final java.lang.String get_errmsg()
                                  throws pCOSException
Get a detailed description of the last exception.

Returns:
pCOSlib error message
Throws:
pCOSException

get_errnum

public final int get_errnum()
                     throws pCOSException
Return the error number of the last error.

Returns:
pCOSlib error number
Throws:
pCOSException

open_document

public final int open_document(java.lang.String filename,
                               java.lang.String optlist)
                        throws pCOSException
Open a PDF document from file.

Returns:
-1 on error, and a document handle otherwise
Throws:
pCOSException - May throw an exception for various reasons.

open_document_mem

public final int open_document_mem(byte[] data,
                                   java.lang.String optlist)
                            throws pCOSException
Deprecated. Use create_pvf()/delete_pvf().

Open a PDF document from memory.

Returns:
-1 on error, and a document handle otherwise
Throws:
pCOSException - May throw an exception for various reasons.

pcos_get_number

public final double pcos_get_number(int doc,
                                    java.lang.String path)
                             throws pCOSException
Get pCOS path value with numerical type.

Returns:
The numerical value of the parameter.
Throws:
pCOSException - May throw an exception for various reasons.

get_number

public final double get_number(int doc,
                               java.lang.String path)
                        throws pCOSException
Deprecated. Use pcos_get_number().

Get pCOS path value with numerical type.

Returns:
The numerical value of the parameter.
Throws:
pCOSException - May throw an exception for various reasons.

pcos_get_string

public final java.lang.String pcos_get_string(int doc,
                                              java.lang.String path)
                                       throws pCOSException
Get pCOS path value with string type.

Returns:
The parameter's string value
Throws:
pCOSException - May throw an exception for various reasons.

get_string

public final java.lang.String get_string(int doc,
                                         java.lang.String path)
                                  throws pCOSException
Deprecated. Use pcos_get_string().

Get pCOS path value with string type.

Returns:
The parameter's string value
Throws:
pCOSException - May throw an exception for various reasons.

pcos_get_stream

public final byte[] pcos_get_stream(int doc,
                                    java.lang.String optlist,
                                    java.lang.String path)
                             throws pCOSException
Get pCOS stream object contents.

Returns:
The data contained in the stream.
Throws:
pCOSException - May throw an exception for various reasons.

get_stream

public final byte[] get_stream(int doc,
                               java.lang.String optlist,
                               java.lang.String path)
                        throws pCOSException
Deprecated. Use pcos_get_stream().

Get pCOS stream object contents.

Returns:
The data contained in the stream.
Throws:
pCOSException - May throw an exception for various reasons.

set_option

public final void set_option(java.lang.String optlist)
                      throws pCOSException
Set some options.

Throws:
pCOSException - May throw an exception for various reasons.