DynamicPDF by ceTe Software

com.cete.dynamicpdf.io
Class DocumentWriter

java.lang.Object
  |
  +--com.cete.dynamicpdf.io.DocumentWriter

public class DocumentWriter
extends java.lang.Object

Represents a writer class for a document.


Method Summary
 void clearFontSubsetter()
          Clears the current font subsetter.
 void delimit()
           
 int getCurrentObjNum()
          Gets the PDF object number of the currently open PDF object.
 boolean getDelimiterRequired()
          Gets a value indicating if the output needs to be delimited.
 Document getDocument()
          Gets the current document.
 FontSubsetter getFontSubsetter()
          Gets the current font subsetter.
 int getNextObject()
          Returns the next PDF object number that will be used.
 int getPageObject(int pageNumber)
          Returns the PDF object number for the given page.
 int getPosition()
          Gets the position in the document.
 DocumentResourceList getResources()
          Gets a collection of resources.
 void setDelimiterRequired(boolean delimiterRequired)
          Sets a value indicating if the output needs to be delimited.
 FontSubsetter setFontSubsetter(IFontSubsettable subsettableFont)
          Sets the current font subsetter.
 void setPosition(int position)
          Sets the position in the document.
 void write(byte bytVal)
          Writes a byte to the output stream.
 void write(byte[] data)
          Writes a byte array to the output stream.
 void write(byte[] data, int length)
          Writes a portion of a byte array to the output stream.
 void write(byte[] data, int start, int length)
          Writes a portion of a byte array to the output stream.
 void write(float value)
          Writes a float to the output stream.
 void write(java.lang.String text)
          Writes text to the output stream.
 int writeBeginObject()
          Begins a PDF object and send it to the output stream.
 void writeColorValue(float value)
          Writes a color value to the document.
 void writeEndObject()
          Ends a PDF object and send it to the output stream.
 void writeInteger(int value)
          Writes an integer to the output stream.
 void writeNewLine()
          Writes a new line to the document.
 void writeSpace()
          Writes a space to the document.
 void writeStream(byte[] data, int length, boolean preserveData)
          Writes a PDF stream object to the output stream.
 void writeStream(byte[] data, int start, int length, boolean preserveData)
          Writes a PDF stream object to the output stream.
 void writeText(byte[] text)
          Writes a PDF text object to the output stream.
 void writeText(java.lang.String text)
          Writes a PDF text object to the output stream.
 void writeText(java.lang.String textBefore, byte[] text, java.lang.String textAfter)
          Writes a PDF text object to the output stream.
 void writeText(java.lang.String textBefore, java.lang.String text, java.lang.String textAfter)
          Writes a PDF text object to the output stream.
 void writeUnicodeText(java.lang.String text)
          Writes a PDF text object to the output stream.
 void writeUnicodeText(java.lang.String textBefore, java.lang.String text, java.lang.String textAfter)
          Writes a PDF text object to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

delimit

public void delimit()

getPageObject

public int getPageObject(int pageNumber)
Returns the PDF object number for the given page.

Throws:
GeneratorException - if page number is invalid.
EmptyDocumentException - if document has no pages.
Parameters:
pageNumber - Page number in the document.
Returns:
int value specifying the PDF object number for the given page.

write

public void write(java.lang.String text)
Writes text to the output stream.

Parameters:
text - the String value to write.

writeBeginObject

public int writeBeginObject()
Begins a PDF object and send it to the output stream.

Returns:
The int value specifying PDF object number of the new object.

getNextObject

public int getNextObject()
Returns the next PDF object number that will be used.

Returns:
The int value specifying next PDF object number.

writeText

public void writeText(java.lang.String textBefore,
                      java.lang.String text,
                      java.lang.String textAfter)
Writes a PDF text object to the output stream.

Parameters:
textBefore - The String object containing text to appear before the PDF text object.
text - The String object containing text of the text object to write.
textAfter - The String object containing text to appear after the PDF text object.

writeText

public void writeText(java.lang.String textBefore,
                      byte[] text,
                      java.lang.String textAfter)
Writes a PDF text object to the output stream.

Parameters:
textBefore - The String object containing text to appear before the PDF text object.
text - The byte array containing text of the text object to write.
textAfter - The String object containing text to appear after the PDF text object.

writeEndObject

public void writeEndObject()
Ends a PDF object and send it to the output stream.


writeInteger

public void writeInteger(int value)
Writes an integer to the output stream.

Parameters:
value - The integer value to write.

write

public void write(float value)
Writes a float to the output stream.

Parameters:
value - The float value to write.

write

public void write(byte bytVal)
Writes a byte to the output stream.

Parameters:
bytVal - the byte to write.

writeText

public void writeText(java.lang.String text)
Writes a PDF text object to the output stream.

Parameters:
text - The String value indicating text of the text object to write.

writeUnicodeText

public void writeUnicodeText(java.lang.String textBefore,
                             java.lang.String text,
                             java.lang.String textAfter)
Writes a PDF text object to the output stream.

Parameters:
textBefore - String text to appear before the PDF text object.
text - String text of the text object to write.
textAfter - String text to appear after the PDF text object

writeUnicodeText

public void writeUnicodeText(java.lang.String text)
Writes a PDF text object to the output stream.

Parameters:
text - String text of the text object to write.

writeText

public void writeText(byte[] text)
Writes a PDF text object to the output stream.

Parameters:
text - The byte array containing text of the text object to write.

write

public void write(byte[] data)
Writes a byte array to the output stream.

Parameters:
data - byte array to output.

write

public void write(byte[] data,
                  int length)
Writes a portion of a byte array to the output stream.

Parameters:
data - byte array to output.
length - integer length of output.

write

public void write(byte[] data,
                  int start,
                  int length)
Writes a portion of a byte array to the output stream.

Parameters:
data - byte array to output.
start - int value indicating start of output.
length - integer length of output.

writeStream

public void writeStream(byte[] data,
                        int length,
                        boolean preserveData)
Writes a PDF stream object to the output stream.

Parameters:
data - the byte array to output.
length - the int value containing length of output.
preserveData - this boolean value specifies if the data must be preserved for future use.

writeStream

public void writeStream(byte[] data,
                        int start,
                        int length,
                        boolean preserveData)
Writes a PDF stream object to the output stream.

Parameters:
data - Byte array to output.
start - Start of output.
length - Length of output.
preserveData - Specifies if the data must be preserved for future use.

writeSpace

public void writeSpace()
Writes a space to the document.


writeNewLine

public void writeNewLine()
Writes a new line to the document.


writeColorValue

public void writeColorValue(float value)
Writes a color value to the document.

Parameters:
value - the float Color value to write.

setDelimiterRequired

public void setDelimiterRequired(boolean delimiterRequired)
Sets a value indicating if the output needs to be delimited.


getDelimiterRequired

public boolean getDelimiterRequired()
Gets a value indicating if the output needs to be delimited.


getResources

public DocumentResourceList getResources()
Gets a collection of resources.

Returns:
the DocumentResourceList object.

getCurrentObjNum

public int getCurrentObjNum()
Gets the PDF object number of the currently open PDF object.

Returns:
the int value specifying object number of current PDF object.

setFontSubsetter

public FontSubsetter setFontSubsetter(IFontSubsettable subsettableFont)
Sets the current font subsetter.

Parameters:
subsettableFont - Subsettable font to use for setting the current font subsetter.
Returns:
The current font subsetter.
See Also:
IFontSubsettable, FontSubsetter

clearFontSubsetter

public void clearFontSubsetter()
Clears the current font subsetter.


getDocument

public Document getDocument()
Gets the current document.

Returns:
the current Document object.

setPosition

public void setPosition(int position)
Sets the position in the document.

Parameters:
position - the int value representing the position in the current document

getPosition

public int getPosition()
Gets the position in the document.

Returns:
the int value representing the position in the current document.

getFontSubsetter

public FontSubsetter getFontSubsetter()
Gets the current font subsetter.

Returns:
Current font subsetter.
See Also:
FontSubsetter

DynamicPDF by ceTe Software

API Reference for DynamicPDF™ for Java generated on December 20, 2005
© Copyright 2005, ceTe Software