|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.pdf.object.PDFObject
public abstract class PDFObject
generic PDF object. A PDF Document is essentially a collection of these objects. A PDF Object has a number and a generation (although the generation will always be 0 in new documents).
Field Summary | |
---|---|
static String |
EOL
The String that should be used to end a line in the PDF document. |
static String |
MSG_EOL
The String that should be used to end a line in log messages. |
static String |
XREF_EOL
The String that should be used to end a cross-reference line in the PDF document. |
Constructor Summary | |
---|---|
PDFObject()
No-parameter constructor, useful for objects that are not tied to a specific PDF document. |
|
PDFObject(PDFDocument doc)
Create an empty object. |
Method Summary | |
---|---|
protected static byte[] |
bufferToByteArray(StringBuilder buffer)
Converts a StringBuilder buffer to an array of bytes. |
protected void |
byteArrayToStream(byte[] bytes,
OutputStream stream)
Writes the content of a byte array to an output stream. |
int |
getCharsPerLine()
Return the number of characters per line that should be written into the PDF. |
int |
getGeneration()
Returns this object's generation number. |
org.apache.commons.logging.Log |
getLogger()
Returns the logger to be used for user messages. |
int |
getNumber()
Returns this object's number. |
PDFDocument |
getPDFDocument()
Returns the parent PDF document. |
protected int |
output(OutputStream stream)
Write the PDF represention of this object to a given output stream. |
protected String |
pdfID()
The String used to identify this object as it is written in the PDF. |
String |
pdfReference()
The String used to reference this object within the PDF. |
protected void |
setNumber(int number)
Sets this object's number if it has not already been set. |
protected static byte[] |
stringToByteArray(String string)
Converts a String to an array of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EOL
public static final String XREF_EOL
public static final String MSG_EOL
Constructor Detail |
---|
public PDFObject(PDFDocument doc)
doc
- The PDFDocument to which this object is attached.public PDFObject()
Method Detail |
---|
protected void setNumber(int number)
number
- The new object number.public int getNumber()
public int getGeneration()
protected int output(OutputStream stream) throws org.axsl.pdf.PdfException
stream
- The stream to which the PDF content is being written.
org.axsl.pdf.PdfException
- For I/O errors during output.public String pdfReference()
protected String pdfID()
protected static byte[] bufferToByteArray(StringBuilder buffer)
buffer
- The input StringBuilder.
protected static byte[] stringToByteArray(String string)
string
- The input String.
protected void byteArrayToStream(byte[] bytes, OutputStream stream) throws org.axsl.pdf.PdfException
stream
- The stream to which the array should be written.bytes
- The array to be written.
org.axsl.pdf.PdfException
- For IO errors during output.public org.apache.commons.logging.Log getLogger()
public PDFDocument getPDFDocument()
public int getCharsPerLine()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |