com.pdflib
Class plop

java.lang.Object
  extended bycom.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.0p1
Author:
Rainer Schaaf

Constructor Summary
plop()
          Create a new PLOP context.
 
Method Summary
 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.
 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 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

close_document

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

Throws:
PLOPException - PDF 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 - PDF 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.

Throws:
PLOPException - PDF 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 - PDF 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 - PDF output cannot be finished after an exception.

get_apiname

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

Throws:
PLOPException - PDF 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.

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

get_errmsg

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

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

get_errnum

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

Throws:
PLOPException - PDF 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 - PDF 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.

Throws:
PLOPException - PDF 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.

Throws:
PLOPException - PDF 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.

Throws:
PLOPException - PDF 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.

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

prepare_signature

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

Throws:
PLOPException - PDF 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 - PDF 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.