Package com.tom_roush.pdfbox.pdmodel.fdf
Class FDFDictionary
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.fdf.FDFDictionary
-
- All Implemented Interfaces:
COSObjectable
public class FDFDictionary extends Object implements COSObjectable
This represents an FDF dictionary that is part of the FDF document.
-
-
Constructor Summary
Constructors Constructor Description FDFDictionary()Default constructor.FDFDictionary(COSDictionary fdfDictionary)Constructor.FDFDictionary(Element fdfXML)This will create an FDF dictionary from an XFDF XML document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FDFAnnotation>getAnnotations()This will get the list of FDF Annotations.COSDictionarygetCOSObject()Convert this standard java object to a COS object.COSStreamgetDifferences()This will get the incremental updates since the PDF was last opened.List<PDFileSpecification>getEmbeddedFDFs()This will get the list of embedded FDF entries, or null if the entry is null.StringgetEncoding()The encoding to be used for a FDF field.List<FDFField>getFields()This will get the list of FDF Fields.PDFileSpecificationgetFile()The source file or target file: the PDF document file that this FDF file was exported from or is intended to be imported into.COSArraygetID()This is the FDF id.FDFJavaScriptgetJavaScript()This will get the java script entry.List<FDFPage>getPages()This will get the list of FDF Pages.StringgetStatus()This will get the status string to be displayed as the result of an action.StringgetTarget()This will get the target frame in the browser to open this document.voidsetAnnotations(List<FDFAnnotation> annots)This will set the list of annotations.voidsetDifferences(COSStream diff)This will set the differences stream.voidsetEmbeddedFDFs(List embedded)This will set the list of embedded FDFs.voidsetEncoding(String encoding)This will set the encoding.voidsetFields(List<FDFField> fields)This will set the list of fields.voidsetFile(PDFileSpecification fs)This will set the file specification.voidsetID(COSArray id)This will set the FDF id.voidsetJavaScript(FDFJavaScript js)This will set the JavaScript entry.voidsetPages(List pages)This will set the list of pages.voidsetStatus(String status)This will set the status string.voidsetTarget(String target)This will set the target frame in the browser to open this document.voidwriteXML(Writer output)This will write this element as an XML document.
-
-
-
Constructor Detail
-
FDFDictionary
public FDFDictionary()
Default constructor.
-
FDFDictionary
public FDFDictionary(COSDictionary fdfDictionary)
Constructor.- Parameters:
fdfDictionary- The FDF documents catalog.
-
FDFDictionary
public FDFDictionary(Element fdfXML)
This will create an FDF dictionary from an XFDF XML document.- Parameters:
fdfXML- The XML document that contains the XFDF data.- Throws:
IOException- If there is an error reading from the dom.
-
-
Method Detail
-
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.- Throws:
IOException- If there is an error writing the XML.
-
getCOSObject
public COSDictionary getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
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.
- Throws:
IOException- If there is an error creating the file spec.
-
setFile
public void setFile(PDFileSpecification fs)
This will set the file specification.- Parameters:
fs- The file specification.
-
getID
public COSArray getID()
This is the FDF id.- Returns:
- The FDF ID.
-
setID
public void setID(COSArray id)
This will set the FDF id.- Parameters:
id- The new id for the FDF.
-
getFields
public List<FDFField> getFields()
This will get the list of FDF Fields. This will return a list of FDFField objects.- Returns:
- A list of FDF fields.
-
setFields
public void setFields(List<FDFField> fields)
This will set the list of fields. This should be a list of FDFField objects.- Parameters:
fields- The list of fields.
-
getStatus
public String getStatus()
This will get the status string to be displayed as the result of an action.- Returns:
- The status.
-
setStatus
public void setStatus(String status)
This will set the status string.- Parameters:
status- The new status string.
-
getPages
public List<FDFPage> getPages()
This will get the list of FDF Pages. This will return a list of FDFPage objects.- Returns:
- A list of FDF pages.
-
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.
-
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.
-
setEncoding
public void setEncoding(String encoding)
This will set the encoding.- Parameters:
encoding- The new encoding.
-
getAnnotations
public List<FDFAnnotation> getAnnotations() throws IOException
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.
- Throws:
IOException- If there is an error creating the annotation list.
-
setAnnotations
public void setAnnotations(List<FDFAnnotation> annots)
This will set the list of annotations. This should be a list of FDFAnnotation objects.- Parameters:
annots- The list of annotations.
-
getDifferences
public COSStream getDifferences()
This will get the incremental updates since the PDF was last opened.- Returns:
- The differences entry of the FDF dictionary.
-
setDifferences
public void setDifferences(COSStream diff)
This will set the differences stream.- Parameters:
diff- The new differences stream.
-
getTarget
public String getTarget()
This will get the target frame in the browser to open this document.- Returns:
- The target frame.
-
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.
-
getEmbeddedFDFs
public List<PDFileSpecification> 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.
- Throws:
IOException- If there is an error creating the file spec.
-
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.
-
getJavaScript
public FDFJavaScript getJavaScript()
This will get the java script entry.- Returns:
- The java script entry describing javascript commands.
-
setJavaScript
public void setJavaScript(FDFJavaScript js)
This will set the JavaScript entry.- Parameters:
js- The javascript entries.
-
-