org.pdfbox.pdmodel.fdf

Class FDFDictionary

Implemented Interfaces:
COSObjectable

public class FDFDictionary
extends java.lang.Object
implements COSObjectable

This represents an FDF dictionary that is part of the FDF document.
Version:
$Revision: 1.8 $
Author:
Ben Litchfield

Constructor Summary

FDFDictionary()
Default constructor.
FDFDictionary(Element fdfXML)
This will create an FDF dictionary from an XFDF XML document.
FDFDictionary(COSDictionary fdfDictionary)
Constructor.

Method Summary

List
getAnnotations()
This will get the list of FDF Annotations.
COSDictionary
getCOSDictionary()
Convert this standard java object to a COS object.
COSBase
getCOSObject()
Convert this standard java object to a COS object.
COSStream
getDifferences()
This will get the incremental updates since the PDF was last opened.
List
getEmbeddedFDFs()
This will get the list of embedded FDF entries, or null if the entry is null.
String
getEncoding()
The encoding to be used for a FDF field.
List
getFields()
This will get the list of FDF Fields.
PDFileSpecification
getFile()
The source file or target file: the PDF document file that this FDF file was exported from or is intended to be imported into.
COSArray
getID()
This is the FDF id.
FDFJavaScript
getJavaScript()
This will get the java script entry.
List
getPages()
This will get the list of FDF Pages.
String
getStatus()
This will get the status string to be displayed as the result of an action.
String
getTarget()
This will get the target frame in the browser to open this document.
void
setAnnotations(List annots)
This will set the list of annotations.
void
setDifferences(COSStream diff)
This will set the differences stream.
void
setEmbeddedFDFs(List embedded)
This will set the list of embedded FDFs.
void
setEncoding(String encoding)
This will set the encoding.
void
setFields(List fields)
This will set the list of fields.
void
setFile(PDFileSpecification fs)
This will set the file specification.
void
setID(COSArray id)
This will set the FDF id.
void
setJavaScript(FDFJavaScript js)
This will set the JavaScript entry.
void
setPages(List pages)
This will set the list of pages.
void
setStatus(String status)
This will set the status string.
void
setTarget(String target)
This will set the target frame in the browser to open this document.
void
writeXML(Writer output)
This will write this element as an XML document.

Constructor Details

FDFDictionary

public FDFDictionary()
Default constructor.

FDFDictionary

public FDFDictionary(Element fdfXML)
            throws IOException
This will create an FDF dictionary from an XFDF XML document.
Parameters:
fdfXML - The XML document that contains the XFDF data.

FDFDictionary

public FDFDictionary(COSDictionary fdfDictionary)
Constructor.
Parameters:
fdfDictionary - The FDF documents catalog.

Method Details

getAnnotations

public List getAnnotations()
This will get the list of FDF Annotations. This will return a list of FDFAnnotation objects or null if the entry is not set.
Returns:
A list of FDF annotations.

getCOSDictionary

public COSDictionary getCOSDictionary()
Convert this standard java object to a COS object.
Returns:
The cos object that matches this Java object.

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.
Specified by:
getCOSObject in interface COSObjectable
Returns:
The cos object that matches this Java object.

getDifferences

public COSStream getDifferences()
This will get the incremental updates since the PDF was last opened.
Returns:
The differences entry of the FDF dictionary.

getEmbeddedFDFs

public List getEmbeddedFDFs()
            throws IOException
This will get the list of embedded FDF entries, or null if the entry is null. This will return a list of PDFileSpecification objects.
Returns:
A list of embedded FDF files.

getEncoding

public String getEncoding()
The encoding to be used for a FDF field. The default is PDFDocEncoding and this method will never return null.
Returns:
The encoding value.

getFields

public List getFields()
This will get the list of FDF Fields. This will return a list of FDFField objects.
Returns:
A list of FDF fields.

getFile

public PDFileSpecification getFile()
            throws IOException
The source file or target file: the PDF document file that this FDF file was exported from or is intended to be imported into.
Returns:
The F entry of the FDF dictionary.

getID

public COSArray getID()
This is the FDF id.
Returns:
The FDF ID.

getJavaScript

public FDFJavaScript getJavaScript()
This will get the java script entry.
Returns:
The java script entry describing javascript commands.

getPages

public List getPages()
This will get the list of FDF Pages. This will return a list of FDFPage objects.
Returns:
A list of FDF pages.

getStatus

public String getStatus()
This will get the status string to be displayed as the result of an action.
Returns:
The status.

getTarget

public String getTarget()
This will get the target frame in the browser to open this document.
Returns:
The target frame.

setAnnotations

public void setAnnotations(List annots)
This will set the list of annotations. This should be a list of FDFAnnotation objects.
Parameters:
annots - The list of annotations.

setDifferences

public void setDifferences(COSStream diff)
This will set the differences stream.
Parameters:
diff - The new differences stream.

setEmbeddedFDFs

public void setEmbeddedFDFs(List embedded)
This will set the list of embedded FDFs. This should be a list of PDFileSpecification objects.
Parameters:
embedded - The list of embedded FDFs.

setEncoding

public void setEncoding(String encoding)
This will set the encoding.
Parameters:
encoding - The new encoding.

setFields

public void setFields(List fields)
This will set the list of fields. This should be a list of FDFField objects.
Parameters:
fields - The list of fields.

setFile

public void setFile(PDFileSpecification fs)
This will set the file specification.
Parameters:
fs - The file specification.

setID

public void setID(COSArray id)
This will set the FDF id.
Parameters:
id - The new id for the FDF.

setJavaScript

public void setJavaScript(FDFJavaScript js)
This will set the JavaScript entry.
Parameters:
js - The javascript entries.

setPages

public void setPages(List pages)
This will set the list of pages. This should be a list of FDFPage objects.
Parameters:
pages - The list of pages.

setStatus

public void setStatus(String status)
This will set the status string.
Parameters:
status - The new status string.

setTarget

public void setTarget(String target)
This will set the target frame in the browser to open this document.
Parameters:
target - The new target frame.

writeXML

public void writeXML(Writer output)
            throws IOException
This will write this element as an XML document.
Parameters:
output - The stream to write the xml to.