flex.acrobat.pdf
Class XFAHelper

java.lang.Object
  extended by flex.acrobat.pdf.AbstractHelper
      extended by flex.acrobat.pdf.XFAHelper
All Implemented Interfaces:
flex.acrobat.pdf.XFAConstants
Direct Known Subclasses:
XDPXFAHelper

public class XFAHelper
extends AbstractHelper
implements flex.acrobat.pdf.XFAConstants

XFAHelper is utility class for manipulating XFA datasets in PDF files created with Acrobat Professional or LiveCycle Designer. Versions 7 and 8 are currently supported.

An example usage of this class is included below:

 private void importDataset(File template, File generated, Document dataset)
 {
     XFAHelper helper = new XFAHelper();
     helper.open(template);
     helper.importDataset(dataset);
     helper.save(generated);
     helper.close();
     // ...
 }
 


Field Summary
 
Fields inherited from interface flex.acrobat.pdf.XFAConstants
XFA_DATA_NAMESPACE, XFA_TEMPLATE_NAMESPACE, XFADATA_DATA_QUALIFIED_NODE, XFADATA_DATANODE_ATTR_VALUE, XFADATA_DATANODE_QUALIFIED_ATTR, XFADATA_DATASETS_NODE, XFADATA_DATASETS_QUALIFIED_NODE, XFADATA_PREFIX
 
Constructor Summary
XFAHelper()
          Constructor.
 
Method Summary
 void close()
          Closes the updated PDF document to free associated resources.
 void importDataset(Document dataset)
          Imports a new XFA dataset into the current PDF document.
 void importDataset(InputStream dataSetStream)
          Imports a new XFA dataset into the current PDF document.
 void open(File file)
          Opens a PDF document that is a pre-rendered shell containing an XFA template from a file.
 void open(InputStream in)
          Opens a PDF document that is a pre-rendered shell containing an XFA template from an InputStream.
 void open(String location)
          Opens a PDF document that is a pre-rendered shell containing an XFA template from a file path location.
 void openFromByteArray(byte[] bytes)
          Opens a PDF document that is a pre-rendered shell containing an XFA template from a byte array.
 void save(File file)
          Saves the current PDF to the given file.
 void save(OutputStream out)
          Saves the updated PDF document to an OutputStream.
 void save(String location)
          Saves the updated PDF to the given file location.
 byte[] saveToByteArray()
          Saves the updated PDF document as a byte array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFAHelper

public XFAHelper()
Constructor.

Method Detail

importDataset

public void importDataset(InputStream dataSetStream)
Imports a new XFA dataset into the current PDF document. An existing dataset will be replaced by this action.

Parameters:
dataSetStream - An InputStream of an XML model to server as an XFA dataset.

importDataset

public void importDataset(Document dataset)
Imports a new XFA dataset into the current PDF document. An existing dataset will be replaced by this action.

Parameters:
dataset - A Document representing the XML model of an XFA dataset.

open

public void open(File file)
          throws IOException
Opens a PDF document that is a pre-rendered shell containing an XFA template from a file.

Overrides:
open in class AbstractHelper
Parameters:
file - - a File representing a shell PDF.
Throws:
IOException

open

public void open(InputStream in)
          throws IOException
Opens a PDF document that is a pre-rendered shell containing an XFA template from an InputStream.

Overrides:
open in class AbstractHelper
Parameters:
in - Any InputStream that will return the bytes representing a shell PDF.
Throws:
IOException

open

public void open(String location)
          throws IOException
Opens a PDF document that is a pre-rendered shell containing an XFA template from a file path location.

Overrides:
open in class AbstractHelper
Parameters:
location - - a String representing the fully qualified path to the shell PDF.
Throws:
IOException

openFromByteArray

public void openFromByteArray(byte[] bytes)
Opens a PDF document that is a pre-rendered shell containing an XFA template from a byte array.

Overrides:
openFromByteArray in class AbstractHelper
Parameters:
bytes - An array of bytes representing a shell PDF.

save

public final void save(File file)
                throws IOException
Saves the current PDF to the given file. If the file already exists it will be deleted and replaced with the updated PDF.

Overrides:
save in class AbstractHelper
Parameters:
location - - a fully qualified path that will hold the updated PDF file.
Throws:
IOException

save

public final void save(OutputStream out)
                throws IOException
Saves the updated PDF document to an OutputStream.

Overrides:
save in class AbstractHelper
Throws:
IOException

save

public final void save(String location)
                throws IOException
Saves the updated PDF to the given file location. If the location points to an existing file it will be deleted and replaced with the updated PDF.

Overrides:
save in class AbstractHelper
Parameters:
location - - a fully qualified path that will hold the updated PDF file.
Throws:
IOException

saveToByteArray

public final byte[] saveToByteArray()
Saves the updated PDF document as a byte array.

Overrides:
saveToByteArray in class AbstractHelper
Returns:
byte[] A byte array representation of the PDF document.

close

public void close()
Closes the updated PDF document to free associated resources.

Overrides:
close in class AbstractHelper


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/acrobat/pdf/XFAHelper.html