SourceForge.net Logo
aXSL API 0.1

org.axsl.pdfW
Interface PDFDocument


public interface PDFDocument

A PDF document.


Field Summary
static byte PDF_VERSION_1_3
          Constant indicating version 1.3 of the PDF spec.
static byte PDF_VERSION_1_4
          Constant indicating version 1.4 of the PDF spec.
static byte PDF_VERSION_1_5
          Constant indicating version 1.5 of the PDF spec.
static byte PDF_VERSION_1_6
          Constant indicating version 1.6 of the PDF spec.
static byte[] VALID_VERSIONS
          Constant containing the valid PDF versions.
static java.lang.String[] VERSION_STRINGS
          Constant containing the valid PDF version strings.
 
Method Summary
 void addDefaultFilter(java.lang.String filterName)
          Adds a standard filter to the document.
 void close(java.io.OutputStream stream)
          Closes the OutputStream.
 PDFColor createPDFColor(java.awt.Color color)
          Get or create an implementation-specific PDFColor instance.
 PDFEncryption createPDFEncryption()
          Create an implementation-specific PDFEncryption instance to be used by this document.
 PDFPage createPDFPage(int pagewidth, int pageheight)
          Create an implementation-specific PDFPage instance.
 PDFOutlineParent getOutlineRoot()
          Get the root Outlines object.
 PDFFont getPDFFont(FontUse fontUse)
          Looks up or creates a PDFFont for a given font.
 void outputHeader(java.io.OutputStream outputStream)
          Writes the PDF header.
 void resetGraphicsState()
          Resets the Graphics State.
 void setCreationDate(java.util.Date creationDate)
          Sets the "creation date" document meta-information for the PDF document.
 void setProducer(java.lang.String producer)
          Sets the "producer" document meta-information for the PDF document.
 void setVersion(int newVersion)
          Sets the PDF version that should be created when this document is written.
 void writeIndirectObjects(java.io.OutputStream stream)
          Writes any used but unwritten indirect objects into the stream.
 

Field Detail

PDF_VERSION_1_3

public static final byte PDF_VERSION_1_3
Constant indicating version 1.3 of the PDF spec.

See Also:
Constant Field Values

PDF_VERSION_1_4

public static final byte PDF_VERSION_1_4
Constant indicating version 1.4 of the PDF spec.

See Also:
Constant Field Values

PDF_VERSION_1_5

public static final byte PDF_VERSION_1_5
Constant indicating version 1.5 of the PDF spec.

See Also:
Constant Field Values

PDF_VERSION_1_6

public static final byte PDF_VERSION_1_6
Constant indicating version 1.6 of the PDF spec.

See Also:
Constant Field Values

VALID_VERSIONS

public static final byte[] VALID_VERSIONS
Constant containing the valid PDF versions.


VERSION_STRINGS

public static final java.lang.String[] VERSION_STRINGS
Constant containing the valid PDF version strings.

Method Detail

setVersion

public void setVersion(int newVersion)
                throws PDFException
Sets the PDF version that should be created when this document is written. If not set, the default value is implementation-dependent. Note that setting this value to a lower version will only eliminate features that are known to cause problems in PDF applications supporting a lower version. If a feature is not supported in a lower version, but causes no problems for that lower version, it will be included, so that applications supporting higher versions may take advantage of it.

Parameters:
newVersion - One of #PDF_VERSION_1_3, #PDF_VERSION_1_4, #PDF_VERSION_1_5, or #PDF_VERSION_1_6.
Throws:
PDFException - For an invalid PDF version.

setProducer

public void setProducer(java.lang.String producer)
Sets the "producer" document meta-information for the PDF document.

Parameters:
producer - The name of the producer of the PDF document.

setCreationDate

public void setCreationDate(java.util.Date creationDate)
Sets the "creation date" document meta-information for the PDF document.

Parameters:
creationDate - The creation date of the PDF document.

addDefaultFilter

public void addDefaultFilter(java.lang.String filterName)
Adds a standard filter to the document.

Parameters:
filterName - The name of the standard filter to be added.

outputHeader

public void outputHeader(java.io.OutputStream outputStream)
                  throws java.io.IOException
Writes the PDF header.

Parameters:
outputStream - The OutputStream to write the header to.
Throws:
java.io.IOException - If there is an error writing to the OutputStream.

close

public void close(java.io.OutputStream stream)
           throws java.io.IOException
Closes the OutputStream.

Parameters:
stream - The OutputStream to be closed.
Throws:
java.io.IOException - If there is an error closing the OutputStream.

getPDFFont

public PDFFont getPDFFont(FontUse fontUse)
Looks up or creates a PDFFont for a given font.

Parameters:
fontUse - The font instance for which a PDFFont is needed.
Returns:
The PDFFont that is tied to fontUse.

getOutlineRoot

public PDFOutlineParent getOutlineRoot()
Get the root Outlines object.

Returns:
The root Outlines object.

resetGraphicsState

public void resetGraphicsState()
Resets the Graphics State. This should usually be done at the beginning of rendering a new page.


writeIndirectObjects

public void writeIndirectObjects(java.io.OutputStream stream)
                          throws java.io.IOException
Writes any used but unwritten indirect objects into the stream. This can be done as often as desired.

Parameters:
stream - The OutputStream to which the output should be written.
Throws:
java.io.IOException - For errors writing to the OutputStream.

createPDFEncryption

public PDFEncryption createPDFEncryption()
Create an implementation-specific PDFEncryption instance to be used by this document.

Returns:
An implementation-specific PDFEncryption instance.

createPDFColor

public PDFColor createPDFColor(java.awt.Color color)
Get or create an implementation-specific PDFColor instance.

Parameters:
color - The color that should be created.
Returns:
An implementation-specific PDFColor instance.

createPDFPage

public PDFPage createPDFPage(int pagewidth,
                             int pageheight)
Create an implementation-specific PDFPage instance.

Parameters:
pagewidth - The width of the page that should be created, in millipoints.
pageheight - The height of the page that should be created, in millipoints.
Returns:
An implementation-specific PDFPage instance.

SourceForge.net Logo
aXSL API 0.1

This documentation was created September 6 2006 by The aXSL Group and may be freely copied. See license for details.