|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.PdfObject
public abstract class PdfObject
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).
PdfNull
,
PdfBoolean
,
PdfNumber
,
PdfString
,
PdfName
,
PdfArray
,
PdfDictionary
,
PdfStream
,
PdfIndirectReference
Field Summary | |
---|---|
static int |
ARRAY
a possible type of PdfObject |
static int |
BOOLEAN
a possible type of PdfObject |
protected byte[] |
bytes
the content of this PdfObject |
static int |
DICTIONARY
a possible type of PdfObject |
static int |
INDIRECT
a possible type of PdfObject |
protected PRIndirectReference |
indRef
Holds value of property indRef. |
static int |
NAME
a possible type of PdfObject |
static String |
NOTHING
This is an empty string used for the PdfNull -object and for an empty PdfString -object. |
static int |
NULL
a possible type of PdfObject |
static int |
NUMBER
a possible type of PdfObject |
static int |
STREAM
a possible type of PdfObject |
static int |
STRING
a possible type of PdfObject |
static String |
TEXT_PDFDOCENCODING
This is the default encoding to be used for converting Strings into bytes and vice versa. |
static String |
TEXT_UNICODE
This is the encoding to be used to output text in Unicode. |
protected int |
type
the type of this PdfObject |
Constructor Summary | |
---|---|
protected |
PdfObject(int type)
Constructs a PdfObject of a certain type without any content. |
protected |
PdfObject(int type,
byte[] bytes)
Constructs a PdfObject of a certain type with a certain content. |
protected |
PdfObject(int type,
String content)
Constructs a PdfObject of a certain type with a certain content. |
Method Summary | |
---|---|
boolean |
canBeInObjStm()
Can this object be in an object stream? |
byte[] |
getBytes()
Gets the presentation of this object in a byte array |
PRIndirectReference |
getIndRef()
Getter for property indRef. |
boolean |
isArray()
Checks if this PdfObject is of the type PdfArray . |
boolean |
isBoolean()
Checks if this PdfObject is of the type PdfBoolean . |
boolean |
isDictionary()
Checks if this PdfObject is of the type PdfDictionary . |
boolean |
isIndirect()
Checks if this is an indirect object. |
boolean |
isName()
Checks if this PdfObject is of the type PdfName . |
boolean |
isNull()
Checks if this PdfObject is of the type PdfNull . |
boolean |
isNumber()
Checks if this PdfObject is of the type PdfNumber . |
boolean |
isStream()
Checks if this PdfObject is of the type PdfStream . |
boolean |
isString()
Checks if this PdfObject is of the type PdfString . |
int |
length()
Returns the length of the actual content of the PdfObject . |
protected void |
setContent(String content)
Changes the content of this PdfObject . |
void |
setIndRef(PRIndirectReference indRef)
Setter for property indRef. |
void |
toPdf(PdfWriter writer,
OutputStream os)
Writes the PDF representation of this PdfObject as an array of byte s to the writer. |
String |
toString()
Returns the String -representation of this PdfObject . |
int |
type()
Returns the type of this PdfObject . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BOOLEAN
PdfObject
public static final int NUMBER
PdfObject
public static final int STRING
PdfObject
public static final int NAME
PdfObject
public static final int ARRAY
PdfObject
public static final int DICTIONARY
PdfObject
public static final int STREAM
PdfObject
public static final int NULL
PdfObject
public static final int INDIRECT
PdfObject
public static final String NOTHING
PdfNull
-object and for an empty PdfString
-object.
public static final String TEXT_PDFDOCENCODING
public static final String TEXT_UNICODE
protected byte[] bytes
PdfObject
protected int type
PdfObject
protected PRIndirectReference indRef
Constructor Detail |
---|
protected PdfObject(int type)
PdfObject
of a certain type without any content.
type
- type of the new PdfObject
protected PdfObject(int type, String content)
PdfObject
of a certain type with a certain content.
type
- type of the new PdfObject
content
- content of the new PdfObject
as a String
.protected PdfObject(int type, byte[] bytes)
PdfObject
of a certain type with a certain content.
type
- type of the new PdfObject
bytes
- content of the new PdfObject
as an array of byte
.Method Detail |
---|
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
PdfObject
as an array of byte
s to the writer.
writer
- for backwards compatibilityos
- the outputstream to write the bytes to.
IOException
public byte[] getBytes()
public boolean canBeInObjStm()
public String toString()
String
-representation of this PdfObject
.
toString
in class Object
String
public int length()
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().
protected void setContent(String content)
PdfObject
.
content
- the new content of this PdfObject
public int type()
PdfObject
.
public boolean isNull()
PdfObject
is of the type PdfNull
.
true
or false
public boolean isBoolean()
PdfObject
is of the type PdfBoolean
.
true
or false
public boolean isNumber()
PdfObject
is of the type PdfNumber
.
true
or false
public boolean isString()
PdfObject
is of the type PdfString
.
true
or false
public boolean isName()
PdfObject
is of the type PdfName
.
true
or false
public boolean isArray()
PdfObject
is of the type PdfArray
.
true
or false
public boolean isDictionary()
PdfObject
is of the type PdfDictionary
.
true
or false
public boolean isStream()
PdfObject
is of the type PdfStream
.
true
or false
public boolean isIndirect()
public PRIndirectReference getIndRef()
public void setIndRef(PRIndirectReference indRef)
indRef
- New value of property indRef.
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |