public class FDFDocument extends Object implements Closeable
Constructor and Description |
---|
FDFDocument()
Constructor, creates a new FDF document.
|
FDFDocument(COSDocument doc)
Deprecated.
|
FDFDocument(COSDocument doc,
org.apache.pdfbox.io.RandomAccessRead source)
Constructor that uses an existing document.
|
FDFDocument(Document doc)
This will create an FDF document from an XFDF XML document.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This will close the underlying COSDocument object.
|
FDFCatalog |
getCatalog()
This will get the FDF Catalog.
|
COSDocument |
getDocument()
This will get the low level document.
|
void |
save(File fileName)
This will save this document to the filesystem.
|
void |
save(OutputStream output)
This will save the document to an output stream.
|
void |
save(String fileName)
This will save this document to the filesystem.
|
void |
saveXFDF(File fileName)
This will save this document to the filesystem.
|
void |
saveXFDF(String fileName)
This will save this document to the filesystem.
|
void |
saveXFDF(Writer output)
This will save the document to an output stream and close the stream.
|
void |
setCatalog(FDFCatalog cat)
This will set the FDF catalog for this FDF document.
|
void |
writeXML(Writer output)
This will write this element as an XML document.
|
public FDFDocument()
@Deprecated public FDFDocument(COSDocument doc)
FDFDocument(COSDocument, RandomAccessRead)
doc
- The COSDocument that this document wraps.public FDFDocument(COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source)
doc
- The COSDocument that this document wraps.source
- The source that will be closed when this document gets closed, can be null.public FDFDocument(Document doc) throws IOException
doc
- The XML document that contains the XFDF data.IOException
- If there is an error reading from the dom.public void writeXML(Writer output) throws IOException
output
- The stream to write the xml to.IOException
- If there is an error writing the XML.public COSDocument getDocument()
public FDFCatalog getCatalog()
public final void setCatalog(FDFCatalog cat)
cat
- The FDF catalog.public void save(File fileName) throws IOException
fileName
- The file to save as.IOException
- If there is an error saving the document.public void save(String fileName) throws IOException
fileName
- The file to save as.IOException
- If there is an error saving the document.public void save(OutputStream output) throws IOException
output
- The stream to write to.IOException
- If there is an error writing the document.public void saveXFDF(File fileName) throws IOException
fileName
- The file to save as.IOException
- If there is an error saving the document.public void saveXFDF(String fileName) throws IOException
fileName
- The file to save as.IOException
- If there is an error saving the document.public void saveXFDF(Writer output) throws IOException
output
- The stream to write to.IOException
- If there is an error writing the document.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- If there is an error releasing resources.Copyright © 2002–2025 The Apache Software Foundation. All rights reserved.