Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.form

public final Class PDXFAResource

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .InputStream, org.apache.pdfbox.cos.COSArray, .COSBase, .COSStream, org.apache.pdfbox.io.IOUtils, org.apache.pdfbox.pdmodel.common.COSObjectable, org.w3c.dom.Document

An XML Forms Architecture (XFA) resource.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final COSBase

Constructor Summary

AccessConstructor and Description
public
PDXFAResource(COSBase
The xfa resource.
xfaBase
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the XFA content
getBytes
()

Get the XFA content as byte array.

private static byte[]
getBytesFromPacket(final COSArray cosArray)

private static byte[]
public COSBase
getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public Document

Returns:

the XFA content
getDocument
()

Get the XFA content as W3C document.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

xfaback to summary
private final COSBase xfa

Constructor Detail

PDXFAResourceback to summary
public PDXFAResource(COSBase xfaBase)

Constructor.

Parameters
xfaBase:COSBase

The xfa resource.

Method Detail

getBytesback to summary
public byte[] getBytes() throws 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:byte[]

the XFA content

Exceptions
IOException:
if the XFA content could not be created
getBytesFromPacketback to summary
private static byte[] getBytesFromPacket(final COSArray cosArray) throws IOException
getBytesFromStreamback to summary
private static byte[] getBytesFromStream(final COSStream stream) throws IOException
getCOSObjectback to summary
public COSBase getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Doc from org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSBase

The cos object that matches this Java object.

Annotations
@Override
getDocumentback to summary
public Document getDocument() throws IOException

Get the XFA content as W3C document.

Returns:Document

the XFA content

Exceptions
IOException:
if something went wrong when reading the XFA content.
See Also
getBytes()