|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.qoppa.pdfFields.PDFFields
The PDFFields class provides methods to work with interactive PDF forms - also called acroforms.
It can load an existing PDF form and extract acroform fields in XML (XFDF) or FDF format.
It can also load an existing PDF form and import acroform fields from an XML (XFDF) or FDF file and then save
the updated PDF form.
| Constructor Summary | |
PDFFields(InputStream inStream,
IPassword password)
Loads a PDF document from an InputStream. |
|
PDFFields(String fileName,
IPassword password)
Loads a PDF document from a file. |
|
PDFFields(URL url,
IPassword password)
Loads a PDF document from a URL. |
|
| Method Summary | |
void |
exportAsFDF(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
Export AcroForm field data to an output stream in FDF format. |
void |
exportAsFDF(String fileName,
boolean exportEmptyFields)
Exports AcroForm field data to a file in FDF format. |
void |
exportAsXDP(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
Export XFA field data to an output stream in XDP format. |
void |
exportAsXDP(String fileName,
boolean exportEmptyFields)
Exports XFA field data to a file in XDP format. |
void |
exportAsXFDF(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
Export AcroForm field data to an output stream in XFDF format. |
void |
exportAsXFDF(String fileName,
boolean exportEmptyFields)
Exports AcroForm field data to a file in XML format. |
void |
flattenFields(boolean paintButtons,
boolean paintNonPrintableFields)
Flattens the form fields in the current PDF document. |
DocumentInfo |
getDocumentInfo()
Returns a DocumentInfo object containing the information section of a PDF document (author, title, etc.) |
FormField |
getField(String fieldName)
Gets a field by name. |
Vector |
getFieldList()
Gets the list of fields in this AcroForm. |
static String |
getVersion()
Returns version string for jPDFFields. |
void |
importFDF(InputStream inStream)
Import AcroForm field data from an input stream in FDF format. |
void |
importFDF(String fileName)
Import Acroform field data from a file in FDF Format. |
void |
importXDP(InputStream inStream)
Import XFA field data from an input stream in XDP format. |
void |
importXDP(String fileName)
Import XFA field data from a file in XDP Format. |
void |
importXFDF(InputStream inStream)
Import AcroForm field data from an input stream in XML format. |
void |
importXFDF(String fileName)
Import Acroform fields data from a file in XML Format. |
void |
resetFields()
Reset fields values to their default value. |
void |
saveDocument(OutputStream outStream)
Saves this document to an output stream. |
void |
saveDocument(String fileName)
Saves this document to a file. |
static void |
setAppletKey(String key,
Applet applet)
Method to unlock the production version of the library. |
static boolean |
setKey(String key)
Method to unlock the production version of the library. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PDFFields(InputStream inStream,
IPassword password)
throws PDFException
inStream - InputStream to read the PDF document.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFFields(String fileName,
IPassword password)
throws PDFException
fileName - Name of the PDF file.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.
public PDFFields(URL url,
IPassword password)
throws PDFException
url - Location of the PDF document.password - An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword class that can hold a single
password or a list of passwords.| Method Detail |
public DocumentInfo getDocumentInfo()
public static String getVersion()
public void exportAsFDF(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
throws PDFException,
IOException
outStream - The output stream to write the data to.pathToPDFFile - is the relative path from the fdf file to the pdf file name. This parameter can be left null.
This parameter is used to fill the pdf file name entry in the FDF file, the file entry will be set to pathToPDFFile + fileNa
The file entry is used when you open an fdf file to be able to locate the corresponding pdf file.exportEmptyFields - flag to indicate whether empty or null fields should be exported.
Example of pathToPDFFile ../qoppa/mydir
PDFException
IOException
public void exportAsFDF(String fileName,
boolean exportEmptyFields)
throws PDFException,
IOException
fileName - The name of the file to export the data to.exportEmptyFields - flag to indicate whether empty or null fields should be exported.
PDFException
IOException
public void exportAsXFDF(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
throws PDFException
outStream - The output stream to write the data to.pathToPDFFile - is the relative path from the fdf file to the pdf file name. This parameter can be left null.
This parameter is used to fill the pdf file name entry in the FDF file, the file entry will be set to pathToPDFFile + fileNa
The file entry is used when you open an fdf file to be able to locate the corresponding pdf file.
Example of pathToPDFFile ../qoppa/mydirexportEmptyFields - flag to indicate whether empty or null fields should be exported.
PDFException
public void exportAsXFDF(String fileName,
boolean exportEmptyFields)
throws PDFException
fileName - The name of the file to export the data to.exportEmptyFields - flag to indicate whether empty or null fields should be exported.
IOException
PDFException
public void exportAsXDP(String fileName,
boolean exportEmptyFields)
throws IOException,
PDFException
fileName - The name of the file to export the data to.exportEmptyFields - flag to indicate whether empty or null fields should be exported.
IOException - If there are any errors opening or writing to the file.PDFException
public void exportAsXDP(OutputStream outStream,
String pathToPDFFile,
boolean exportEmptyFields)
throws IOException,
PDFException
outStream - The output stream to write the data to.pathToPDFFile - is the relative path from the xdp file to the pdf file name. This parameter can be left null.
This parameter is used to fill the pdf file name reference in the XDP file, the file entry will be set to pathToPDFFile + fileNameexportEmptyFields - flag to indicate whether empty or null fields should be exported.
IOException - If there are any errors writing to the output stream.PDFException
public void flattenFields(boolean paintButtons,
boolean paintNonPrintableFields)
throws PDFException
paintButtons - Flag to indicate whether push buttons should be painted or not.paintNonPrintableFields - Flag to indicate whether non-printable fields should be painted or not.
PDFExceptionpublic Vector getFieldList()
public FormField getField(String fieldName)
fieldName - The name of a field in hierarchical form.
public void importFDF(InputStream inStream)
throws PDFException
inStream - The input stream in FDF format to read the data from.
PDFException
public void importFDF(String fileName)
throws PDFException
fileName - The name of the FDF file to import the data from.
PDFException
public void importXFDF(InputStream inStream)
throws PDFException
inStream - The input stream in XML format to read the data from.
PDFException
public void importXDP(String fileName)
throws PDFException,
IOException
fileName - The name of the XDP file to import the data from.
PDFException, - IOException
PDFException
IOException
public void importXDP(InputStream inStream)
throws PDFException,
IOException
inStream - The input stream in XDP format to read the data from.
throws PDFException, IOException
PDFException
IOException
public void importXFDF(String fileName)
throws PDFException
fileName - The name of the XML file to import the data from.
PDFException
public void resetFields()
throws PDFException
PDFException
public void saveDocument(String fileName)
throws IOException,
PDFException
fileName - Name of the file to save the document.
IOException
PDFException
public void saveDocument(OutputStream outStream)
throws IOException,
PDFException
outStream - OutputStream where the document will be written to.
IOException
PDFException
public static void setAppletKey(String key,
Applet applet)
key - Production key.public static boolean setKey(String key)
key - Production key.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||