Class PDXFAResource
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.form.PDXFAResource
-
- All Implemented Interfaces:
COSObjectable
public final class PDXFAResource extends java.lang.Object implements COSObjectable
An XML Forms Architecture (XFA) resource.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFFER_SIZE
The default buffer sizeprivate COSBase
xfa
-
Constructor Summary
Constructors Constructor Description PDXFAResource(COSBase xfaBase)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
Get the XFA content as byte array.COSBase
getCOSObject()
Convert this standard java object to a COS object.org.w3c.dom.Document
getDocument()
Get the XFA content as W3C document.
-
-
-
Field Detail
-
BUFFER_SIZE
private static final int BUFFER_SIZE
The default buffer size- See Also:
- Constant Field Values
-
xfa
private final COSBase xfa
-
-
Constructor Detail
-
PDXFAResource
public PDXFAResource(COSBase xfaBase)
Constructor.- Parameters:
xfaBase
- The xfa resource.
-
-
Method Detail
-
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- The cos object that matches this Java object.
-
getBytes
public byte[] getBytes() throws java.io.IOException
Get the XFA content as byte array. The XFA is either a stream containing the entire XFA resource or an array specifying individual packets that together make up the XFA resource. A packet is a pair of a string and stream. The string contains the name of the XML element and the stream contains the complete text of this XML element. Each packet represents a complete XML element, with the exception of the first and last packet, which specify begin and end tags for the xdp:xdp element. [IS0 32000-1:2008: 12.7.8]- Returns:
- the XFA content
- Throws:
java.io.IOException
-
getDocument
public org.w3c.dom.Document getDocument() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
Get the XFA content as W3C document.- Returns:
- the XFA content
- Throws:
javax.xml.parsers.ParserConfigurationException
- parser exception.org.xml.sax.SAXException
- parser exception.java.io.IOException
- if something went wrong when reading the XFA content.- See Also:
getBytes()
-
-