com.pdflib
Class plop

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

public final class plop
extends java.lang.Object

PDFlib PLOP (PDF Linearization, Optimization, Protection) Note that this is only a syntax summary. For complete information please refer to the PLOP API reference manual which is available in the PDF file PLOP-manual.pdf in the PLOP distribution.

Version:
5.1
Author:
Rainer Schaaf

Constructor Summary
plop()
          Create a new PLOP context.
 
Method Summary
 int add_recipient(java.lang.String optlist)
          Add recipient for encryption with certificate security.
 void close_document(int doc, java.lang.String optlist)
          Close the input and output documents.
 java.lang.String convert_to_unicode(java.lang.String inputformat, byte[] inputstring, java.lang.String optlist)
          Convert an arbitrary encoded string to a Unicode string in several formats.
 int create_document(java.lang.String filename, java.lang.String optlist)
          Create a PDF output document (which may be protected) in memory or on disk file.
 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 PLOP context and release all its internal resources.
 java.lang.String get_apiname()
          Get the name of the API function which threw the last exception or failed.
 byte[] get_buffer()
          Fetch full or partial buffer contents of the output document from memory.
 java.lang.String get_errmsg()
          Get the descriptive text of the last thrown exception, or the reason of a failed function call.
 int get_errnum()
          Get the number of the last thrown exception, or the reason of a failed function call.
 double info_pvf(java.lang.String filename, java.lang.String keyword)
          Query properties of a virtual file or the PDFlib Virtual File system (PVF).
 int open_document(java.lang.String filename, java.lang.String optlist)
          Open a PDF document (which may be protected) for processing.
 void pcos_close_document(int doc, java.lang.String optlist)
          Close PLOP input document via the IpCOS interface.
 double pcos_get_number(int doc, java.lang.String path)
          Get the value of a pCOS path with type number or boolean.
 byte[] pcos_get_stream(int doc, java.lang.String optlist, java.lang.String path)
          Get the value of a pCOS path with type name, number, string, or boolean.
 java.lang.String pcos_get_string(int doc, java.lang.String path)
          Get the value of a pCOS path with type name, string, or boolean.
 int pcos_open_document(java.lang.String filename, java.lang.String optlist)
          Open PLOP input document via the IpCOS interface.
 int prepare_signature(java.lang.String optlist)
          Prepare signature options.
 void set_option(java.lang.String optlist)
          Set one or more global options for PLOP.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

plop

public plop()
     throws PLOPException
Create a new PLOP context.

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

add_recipient

public final int add_recipient(java.lang.String optlist)
                        throws PLOPException
Add recipient for encryption with certificate security.

Returns:
-1 on error, and 1 otherwise.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

close_document

public final void close_document(int doc,
                                 java.lang.String optlist)
                          throws PLOPException
Close the input and output documents.

Throws:
PLOPException - PLOP output cannot be finished after an exception.

convert_to_unicode

public final java.lang.String convert_to_unicode(java.lang.String inputformat,
                                                 byte[] inputstring,
                                                 java.lang.String optlist)
                                          throws PLOPException
Convert an arbitrary encoded string to a Unicode string in several formats.

Returns:
The converted Unicode string.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

create_document

public final int create_document(java.lang.String filename,
                                 java.lang.String optlist)
                          throws PLOPException
Create a PDF output document (which may be protected) in memory or on disk file.

Returns:
-1 on error, and a document handle otherwise.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

create_pvf

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

Throws:
PLOPException - PLOP output cannot be finished after an exception.

delete_pvf

public final int delete_pvf(java.lang.String filename)
                     throws PLOPException
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:
PLOPException - PLOP output cannot be finished after an exception.

get_apiname

public final java.lang.String get_apiname()
Get the name of the API function which threw the last exception or failed.

Returns:
The name of a PLOP API function.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

get_buffer

public final byte[] get_buffer()
                        throws PLOPException
Fetch full or partial buffer contents of the output document from memory.

Returns:
A buffer containing output data.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

get_errmsg

public final java.lang.String get_errmsg()
Get the descriptive text of the last thrown exception, or the reason of a failed function call.

Returns:
A string describing the error, or an empty string if the last API call didn<92>t cause any error.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

get_errnum

public final int get_errnum()
Get the number of the last thrown exception, or the reason of a failed function call.

Returns:
The exception<92>s error number.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

info_pvf

public final double info_pvf(java.lang.String filename,
                             java.lang.String keyword)
                      throws PLOPException
Query properties of a virtual file or the PDFlib Virtual File system (PVF).

Returns:
The value of some file parameter as requested by keyword.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

open_document

public final int open_document(java.lang.String filename,
                               java.lang.String optlist)
                        throws PLOPException
Open a PDF document (which may be protected) for processing.

Returns:
-1 on error, and a document handle otherwise.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

pcos_get_number

public final double pcos_get_number(int doc,
                                    java.lang.String path)
                             throws PLOPException
Get the value of a pCOS path with type number or boolean.

Returns:
The numerical value of the object identified by the pCOS path.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

pcos_get_stream

public final byte[] pcos_get_stream(int doc,
                                    java.lang.String optlist,
                                    java.lang.String path)
                             throws PLOPException
Get the value of a pCOS path with type name, number, string, or boolean.

Returns:
The unencrypted data contained in the stream or string.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

pcos_get_string

public final java.lang.String pcos_get_string(int doc,
                                              java.lang.String path)
                                       throws PLOPException
Get the value of a pCOS path with type name, string, or boolean.

Returns:
A string with the value of the object identified by the pCOS path.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

prepare_signature

public final int prepare_signature(java.lang.String optlist)
                            throws PLOPException
Prepare signature options.

Returns:
-1 on error, and 1 otherwise.
Throws:
PLOPException - PLOP output cannot be finished after an exception.

set_option

public final void set_option(java.lang.String optlist)
                      throws PLOPException
Set one or more global options for PLOP.

Throws:
PLOPException - PLOP output cannot be finished after an exception.

delete

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


pcos_open_document

public int pcos_open_document(java.lang.String filename,
                              java.lang.String optlist)
                       throws java.lang.Exception
Open PLOP input document via the IpCOS interface.

Throws:
java.lang.Exception

pcos_close_document

public void pcos_close_document(int doc,
                                java.lang.String optlist)
                         throws java.lang.Exception
Close PLOP input document via the IpCOS interface.

Throws:
java.lang.Exception