| java.lang.Object com.lowagie.text.pdf.PdfObject
All known Subclasses: com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfNumber, com.lowagie.text.pdf.PdfBoolean, com.lowagie.text.pdf.PdfArray, com.lowagie.text.pdf.PdfString, com.lowagie.text.pdf.PdfDictionary, com.lowagie.text.pdf.PdfNull, com.lowagie.text.pdf.PdfLiteral, com.lowagie.text.pdf.PdfIndirectReference,
PdfObject | abstract public class PdfObject (Code) | | PdfObject is the abstract superclass of all PDF objects.
PDF supports seven basic types of objects: Booleans, numbers, strings, names,
arrays, dictionaries and streams. In addition, PDF provides a null object.
Objects may be labeled so that they can be referred to by other objects.
All these basic PDF objects are described in the 'Portable Document Format
Reference Manual version 1.3' Chapter 4 (pages 37-54).
See Also: PdfNull See Also: PdfBoolean See Also: PdfNumber See Also: PdfString See Also: PdfName See Also: PdfArray See Also: PdfDictionary See Also: PdfStream See Also: PdfIndirectReference |
Field Summary | |
final public static int | ARRAY | final public static int | BOOLEAN | final public static int | DICTIONARY | final public static int | INDIRECT | final public static int | NAME | final public static String | NOTHING This is an empty string used for the PdfNull -object and for an empty PdfString -object. | final public static int | NULL | final public static int | NUMBER | final public static int | STREAM | final public static int | STRING | final public static String | TEXT_PDFDOCENCODING This is the default encoding to be used for converting Strings into bytes and vice versa. | final public static String | TEXT_UNICODE This is the encoding to be used to output text in Unicode. | protected byte[] | bytes | protected PRIndirectReference | indRef Holds value of property indRef. | protected int | type |
Constructor Summary | |
protected | PdfObject(int type) Constructs a PdfObject of a certain type without any content. | protected | PdfObject(int type, String content) Constructs a PdfObject of a certain type with a certain content. | protected | PdfObject(int type, byte[] bytes) Constructs a PdfObject of a certain type with a certain content. |
Method Summary | |
public boolean | canBeInObjStm() | public byte[] | getBytes() | public PRIndirectReference | getIndRef() Getter for property indRef. | public boolean | isArray() Checks if this PdfObject is of the type PdfArray . | public boolean | isBoolean() Checks if this PdfObject is of the type PdfBoolean . | public boolean | isDictionary() Checks if this PdfObject is of the type PdfDictionary . | public boolean | isIndirect() Checks if this is an indirect object. | public boolean | isName() Checks if this PdfObject is of the type PdfName . | public boolean | isNull() Checks if this PdfObject is of the type PdfNull . | public boolean | isNumber() Checks if this PdfObject is of the type PdfNumber . | public boolean | isStream() Checks if this PdfObject is of the type PdfStream . | public boolean | isString() Checks if this PdfObject is of the type PdfString . | public int | length() Returns the length of the actual content of the PdfObject . | protected void | setContent(String content) Changes the content of this PdfObject . | public void | setIndRef(PRIndirectReference indRef) Setter for property indRef. | public void | toPdf(PdfWriter writer, OutputStream os) Writes the PDF representation of this PdfObject as an array of byte s to the writer. | public String | toString() Returns the String -representation of this PdfObject . | public int | type() Returns the type of this PdfObject . |
ARRAY | final public static int ARRAY(Code) | | a possible type of PdfObject
|
BOOLEAN | final public static int BOOLEAN(Code) | | a possible type of PdfObject
|
DICTIONARY | final public static int DICTIONARY(Code) | | a possible type of PdfObject
|
INDIRECT | final public static int INDIRECT(Code) | | a possible type of PdfObject
|
NAME | final public static int NAME(Code) | | a possible type of PdfObject
|
NOTHING | final public static String NOTHING(Code) | | This is an empty string used for the PdfNull -object and for an empty PdfString -object.
|
NULL | final public static int NULL(Code) | | a possible type of PdfObject
|
NUMBER | final public static int NUMBER(Code) | | a possible type of PdfObject
|
STREAM | final public static int STREAM(Code) | | a possible type of PdfObject
|
STRING | final public static int STRING(Code) | | a possible type of PdfObject
|
TEXT_PDFDOCENCODING | final public static String TEXT_PDFDOCENCODING(Code) | | This is the default encoding to be used for converting Strings into bytes and vice versa.
The default encoding is PdfDocEncoding.
|
TEXT_UNICODE | final public static String TEXT_UNICODE(Code) | | This is the encoding to be used to output text in Unicode.
|
bytes | protected byte[] bytes(Code) | | the content of this PdfObject
|
type | protected int type(Code) | | the type of this PdfObject
|
PdfObject | protected PdfObject(int type)(Code) | | Constructs a PdfObject of a certain type without any content.
Parameters: type - type of the new PdfObject |
PdfObject | protected PdfObject(int type, String content)(Code) | | Constructs a PdfObject of a certain type with a certain content.
Parameters: type - type of the new PdfObject Parameters: content - content of the new PdfObject as a String . |
PdfObject | protected PdfObject(int type, byte[] bytes)(Code) | | Constructs a PdfObject of a certain type with a certain content.
Parameters: type - type of the new PdfObject Parameters: bytes - content of the new PdfObject as an array of byte . |
canBeInObjStm | public boolean canBeInObjStm()(Code) | | Can this object be in an object stream?
true if this object can be in an object stream. |
getBytes | public byte[] getBytes()(Code) | | Gets the presentation of this object in a byte array
a byte array |
isArray | public boolean isArray()(Code) | | Checks if this PdfObject is of the type PdfArray .
true or false |
isBoolean | public boolean isBoolean()(Code) | | Checks if this PdfObject is of the type PdfBoolean .
true or false |
isDictionary | public boolean isDictionary()(Code) | | Checks if this PdfObject is of the type PdfDictionary .
true or false |
isIndirect | public boolean isIndirect()(Code) | | Checks if this is an indirect object.
true if this is an indirect object |
isName | public boolean isName()(Code) | | Checks if this PdfObject is of the type PdfName .
true or false |
isNull | public boolean isNull()(Code) | | Checks if this PdfObject is of the type PdfNull .
true or false |
isNumber | public boolean isNumber()(Code) | | Checks if this PdfObject is of the type PdfNumber .
true or false |
isStream | public boolean isStream()(Code) | | Checks if this PdfObject is of the type PdfStream .
true or false |
isString | public boolean isString()(Code) | | Checks if this PdfObject is of the type PdfString .
true or false |
length | public int length()(Code) | | Returns the length of the actual content of the PdfObject .
In some cases, namely for PdfString and PdfStream ,
this method differs from the method pdfLength because pdfLength
returns the length of the PDF representation of the object, not of the actual content
as does the method length .
Remark: the actual content of an object is in some cases identical to its representation.
The following statement is always true: length() >= pdfLength().
a length |
setContent | protected void setContent(String content)(Code) | | Changes the content of this PdfObject .
Parameters: content - the new content of this PdfObject |
setIndRef | public void setIndRef(PRIndirectReference indRef)(Code) | | Setter for property indRef.
Parameters: indRef - New value of property indRef. |
toPdf | public void toPdf(PdfWriter writer, OutputStream os) throws IOException(Code) | | Writes the PDF representation of this PdfObject as an array of byte s to the writer.
Parameters: writer - for backwards compatibility Parameters: os - the outputstream to write the bytes to. throws: IOException - |
toString | public String toString()(Code) | | Returns the String -representation of this PdfObject .
a String |
type | public int type()(Code) | | Returns the type of this PdfObject .
a type |
|
|