Package com.orsonpdf
Class PDFObject
- java.lang.Object
-
- com.orsonpdf.PDFObject
-
public abstract class PDFObject extends java.lang.ObjectA PDF Object (also referred to as an 'Indirect Object' in the PDF specification). Objects are identified within a document by their PDF object number (which must be unique within the document) and their PDF object generation number.
-
-
Field Summary
Fields Modifier and Type Field Description private intgenerationprivate intnumber
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetGeneration()Returns the PDF object generation number.intgetNumber()Returns the PDF object number (specified in the constructor).abstract byte[]getObjectBytes()Returns the bytes that go between the 'obj' and 'endobj' in the PDF output for this object.java.lang.StringgetReference()Returns the PDF reference string for this object (for example,"2 0 R").private java.lang.StringobjectIntroString()byte[]toPDFBytes()Returns the PDF bytes representing this object.
-
-
-
Constructor Detail
-
PDFObject
protected PDFObject(int number)
Creates a new instance with the specified object number and the default generation number (0).- Parameters:
number- the object number.
-
PDFObject
protected PDFObject(int number, int generation)Creates a new instance.- Parameters:
number- the PDF object number (must be unique within the document).generation- the PDF generation number.
-
-
Method Detail
-
getNumber
public int getNumber()
Returns the PDF object number (specified in the constructor).- Returns:
- The PDF object number.
-
getGeneration
public int getGeneration()
Returns the PDF object generation number.- Returns:
- The PDF object generation number.
-
getReference
public java.lang.String getReference()
Returns the PDF reference string for this object (for example,"2 0 R"). This is the PDF object number followed by a space followed by the PDF object generation number, followed by a space and an'R'.- Returns:
- The PDF reference string.
-
toPDFBytes
public byte[] toPDFBytes() throws java.io.IOExceptionReturns the PDF bytes representing this object.- Returns:
- The PDF bytes representing this object.
- Throws:
java.io.IOException- if there is a problem writing to the byte array.
-
getObjectBytes
public abstract byte[] getObjectBytes() throws java.io.IOExceptionReturns the bytes that go between the 'obj' and 'endobj' in the PDF output for this object.- Returns:
- A byte array.
- Throws:
java.io.IOException- if there is a problem writing to the byte array.
-
objectIntroString
private java.lang.String objectIntroString()
-
-