public class FDFDoc
extends java.lang.Object
Constructor and Description |
---|
FDFDoc()
Default constructor.
|
FDFDoc(byte[] buf)
Open a SDF/Cos document from a memory buffer.
|
FDFDoc(Filter stream)
Open an existing FDF document.
|
FDFDoc(java.io.InputStream stream)
Open an existing FDF document from an InputStream.
|
FDFDoc(java.io.InputStream stream,
int size)
Open an existing FDF document from an InputStream.
|
FDFDoc(SDFDoc sdfdoc)
Create a FDF document from an existing SDF/Cos document.
|
FDFDoc(java.lang.String filepath)
Open an existing FDF document.
|
Modifier and Type | Method and Description |
---|---|
static FDFDoc |
__Create(long impl) |
long |
__GetHandle() |
void |
close()
Close FDFDoc
|
static FDFDoc |
createFromXFDF(java.lang.String xfdf)
Create a new FDFDoc from XFDF input.
|
FDFField |
fieldCreate(java.lang.String field_name,
int field_type)
Create a new interactive form FDFField.
|
FDFField |
fieldCreate(java.lang.String field_name,
int field_type,
Obj field_value)
Create a FDFField with specified name, type and value
|
FDFField |
fieldCreate(java.lang.String field_name,
int field_type,
java.lang.String field_value)
Create a FDFField with specified name, type and string value
|
Obj |
getFDF()
Get the FDF dictionary.
|
FDFField |
getField(java.lang.String field_name)
field_name a string representing the fully qualified name of
the field (e.g.
|
FDFFieldIterator |
getFieldIterator()
An interactive form (sometimes referred to as an AcroForm) is a
collection of fields for gathering information interactively from
the user.
|
FDFFieldIterator |
getFieldIterator(java.lang.String field_name)
Get the field iterator.
|
Obj |
getID()
Get the ID entry from "/Root/FDF" dictionary.
|
java.lang.String |
getPDFFileName()
Get the PDF document file that this FDF file was exported from or is intended
to be imported into.
|
Obj |
getRoot()
Get the root.
|
SDFDoc |
getSDFDoc()
Get the SDFDoc object in FDFDoc
|
Obj |
getTrailer()
Get the trailer.
|
boolean |
isModified()
determine whether the document is modified
|
void |
mergeAnnots(java.lang.String command_file)
Merges XFDF annotations into FDF document.
|
void |
mergeAnnots(java.lang.String command_file,
java.lang.String permitted_user)
Merges XFDF annotations into FDF document.
|
byte[] |
save()
Saves the document to a memory buffer.
|
void |
save(java.io.OutputStream stream)
Saves the document to a an OutputStream.
|
void |
save(java.io.OutputStream stream,
int size)
Saves the document to a an OutputStream.
|
void |
save(java.lang.String path)
Saves the document to a file.
|
java.lang.String |
saveAsXFDF()
Save a FDF document in XFDF format and returns the XFDF string
|
void |
saveAsXFDF(java.lang.String path)
Save a FDF document in XFDF format.
|
void |
setID(Obj id)
Set the ID entry in "/Root/FDF" dictionary.
|
void |
setPDFFileName(java.lang.String filepath)
Set the PDF document file that this FDF file was exported from or is intended
to be imported into.
|
public FDFDoc() throws PDFNetException
PDFNetException
public FDFDoc(SDFDoc sdfdoc) throws PDFNetException
sdfdoc
- An SDF document. Created FDFDoc will
take the ownership of the low-level document.PDFNetException
public FDFDoc(java.lang.String filepath) throws PDFNetException
filepath
- pathname to the file.PDFNetException
public FDFDoc(Filter stream) throws PDFNetException
Note: if the input stream doesn't support Seek() operation the document will load whole data stream in memory before parsing. In case of linearized FDF, the document may be parsed on-the-fly while it is being loaded in memory. Note that since StdFile implements Seek() interface, the document does not have to be fully in memory before it is used. Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream
- input stream containing a serialized document. The input stream may be a
random-access file, memory buffer, slow HTTP connection etc.PDFNetException
public FDFDoc(byte[] buf) throws PDFNetException
Note: the document should be fully loaded in the memory buffer.
buf
- a memory buffer containing the serialized documentPDFNetException
public FDFDoc(java.io.InputStream stream) throws PDFNetException, java.io.IOException
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream
- - input stream containing a serialized document.PDFNetException
java.io.IOException
- Signals that an I/O exception has occurred.public FDFDoc(java.io.InputStream stream, int size) throws PDFNetException, java.io.IOException
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream
- - input stream containing a serialized document.size
- - the expected size of the input stream.PDFNetException
java.io.IOException
- Signals that an I/O exception has occurred.public void close() throws PDFNetException
PDFNetException
public boolean isModified() throws PDFNetException
PDFNetException
public void save(java.lang.String path) throws PDFNetException
path
- The full path name to which the file is saved.PDFNetException
public byte[] save() throws PDFNetException
PDFNetException
public void save(java.io.OutputStream stream) throws PDFNetException, java.io.IOException
stream
- An OutputStream where the document should be serialized.PDFNetException
java.io.IOException
- Signals that an I/O exception has occurred.public void save(java.io.OutputStream stream, int size) throws PDFNetException, java.io.IOException
stream
- An OutputStream where the document should be serialized.size
- The expected size of the output stream.PDFNetException
java.io.IOException
- Signals that an I/O exception has occurred.public Obj getTrailer() throws PDFNetException
PDFNetException
public Obj getRoot() throws PDFNetException
PDFNetException
public Obj getFDF() throws PDFNetException
PDFNetException
public java.lang.String getPDFFileName() throws PDFNetException
PDFNetException
public void setPDFFileName(java.lang.String filepath) throws PDFNetException
filepath
- pathname to the file.PDFNetException
public Obj getID() throws PDFNetException
PDFNetException
public void setID(Obj id) throws PDFNetException
id
- ID array object.PDFNetException
public FDFFieldIterator getFieldIterator() throws PDFNetException
Note: if the document has no AcroForms, HasNext() will return false.
PDFNetException
public FDFFieldIterator getFieldIterator(java.lang.String field_name) throws PDFNetException
field_name
- the field_namePDFNetException
public FDFField getField(java.lang.String field_name) throws PDFNetException
field_name
- the field_namePDFNetException
public FDFField fieldCreate(java.lang.String field_name, int field_type) throws PDFNetException
field_name
- the field_namefield_type
- the field_typePDFNetException
public FDFField fieldCreate(java.lang.String field_name, int field_type, Obj field_value) throws PDFNetException
field_name
- the field_namefield_type
- the field_typefield_value
- the field_valuePDFNetException
public FDFField fieldCreate(java.lang.String field_name, int field_type, java.lang.String field_value) throws PDFNetException
field_name
- the field_namefield_type
- the field_typefield_value
- the field_valuePDFNetException
public SDFDoc getSDFDoc()
public static FDFDoc createFromXFDF(java.lang.String xfdf) throws PDFNetException
xfdf
- the string containing either the file path to a XFDF file, or the XML buffer containing the XFDF.PDFNetException
public void saveAsXFDF(java.lang.String path) throws PDFNetException
path
- the pathPDFNetException
public java.lang.String saveAsXFDF() throws PDFNetException
PDFNetException
public void mergeAnnots(java.lang.String command_file) throws PDFNetException
command_file
- the path to the xml command file, or the xml command itselfPDFNetException
public void mergeAnnots(java.lang.String command_file, java.lang.String permitted_user) throws PDFNetException
command_file
- the path to the xml command file, or the xml command itselfpermitted_user
- the user name of the permitted userPDFNetException
public long __GetHandle()
public static FDFDoc __Create(long impl)