com.adobe.pdf
Class PDFFactory

java.lang.Object
  |
  +--com.adobe.pdf.PDFFactory

public final class PDFFactory
extends java.lang.Object

PDFFactory defines a static PDFFactory object. Using the PDFFactory object, you can associate a data stream representing an existing PDF document or an XDP file with a PDFDocument object that implements the PDFDocument interface.

You can also use a PDFFactory object to create a FileAttachment object that implements the FileAttachment interface.

For information about using a PDFFactory object to create either a PDFDocument object or a FileAttachment object, see the Developer Guide.

See Also:
PDFDocument, FileAttachment

Constructor Summary
PDFFactory()
           
 
Method Summary
static FileAttachment newFileAttachment(java.io.InputStream src, java.lang.String filename, java.lang.String mimetype)
          Creates a new FileAttachment object from a given data stream.
static PDFDocument openDocument(java.io.InputStream input)
          Creates a new PDFDocument object based on a java.io.InputStream object that references an existing PDF or XDP file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFFactory

public PDFFactory()
Method Detail

openDocument

public static PDFDocument openDocument(java.io.InputStream input)
                                throws java.io.IOException,
                                       PDFException
Creates a new PDFDocument object based on a java.io.InputStream object that references an existing PDF or XDP file.

Parameters:
input - A java.io.InputStream object that represents an existing PDF or XDP file.
Returns:
A PDFDocument object.
Throws:
java.io.IOException - If the java.io.InputStream object is invalid.
PDFException - If a PDF exception is raised. For more information, see the API Reference.

newFileAttachment

public static FileAttachment newFileAttachment(java.io.InputStream src,
                                               java.lang.String filename,
                                               java.lang.String mimetype)

Creates a new FileAttachment object from a given data stream. This attachment can then be used to import a data stream into a PDF document using the PDFDocument interface’s importFileAttachment method.

Parameters:
src - A java.io.InputStream object that represents a file that is used as a file attachment.
filename - The file name.
mimetype - The MIME type of the file attachment.
Returns:
A FileAttachment object.