- Direct Known Subclasses:
PdfArray,PdfBoolean,PdfDictionary,PdfIndirectReference,PdfLiteral,PdfName,PdfNull,PdfNumber,PdfString
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.A possible type ofPdfObjectstatic final intDeprecated.A possible type ofPdfObjectprotected byte[]Deprecated.The content of thisPdfObjectstatic final intDeprecated.A possible type ofPdfObjectstatic final intDeprecated.A possible type ofPdfObjectprotected PRIndirectReferenceDeprecated.Holds the indirect reference.static final intDeprecated.A possible type ofPdfObjectstatic final StringDeprecated.An empty string used for thePdfNull-object and for an emptyPdfString-object.static final intDeprecated.A possible type ofPdfObjectstatic final intDeprecated.A possible type ofPdfObjectstatic final intDeprecated.A possible type ofPdfObjectstatic final intDeprecated.A possible type ofPdfObjectstatic final StringDeprecated.This is the default encoding to be used for converting Strings into bytes and vice versa.static final StringDeprecated.This is the encoding to be used to output text in Unicode.protected intDeprecated.The type of thisPdfObject -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdfObject(int type) Deprecated.Constructs aPdfObjectof a certain type without any content.protectedPdfObject(int type, byte[] bytes) Deprecated.Constructs aPdfObjectof a certain type with a certain content.protectedDeprecated.Constructs aPdfObjectof a certain type with a certain content. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Whether this object can be contained in an object stream.byte[]getBytes()Deprecated.Gets the presentation of this object in a byte arrayDeprecated.Get the indirect referencebooleanisArray()Deprecated.Checks if thisPdfObjectis of the typePdfArray.booleanDeprecated.Checks if thisPdfObjectis of the typePdfBoolean.booleanDeprecated.Checks if thisPdfObjectis of the typePdfDictionary.booleanDeprecated.Checks if thisPdfObjectis of the typePdfIndirectObject.booleanisName()Deprecated.Checks if thisPdfObjectis of the typePdfName.booleanisNull()Deprecated.Checks if thisPdfObjectis of the typePdfNull.booleanisNumber()Deprecated.Checks if thisPdfObjectis of the typePdfNumber.booleanisStream()Deprecated.Checks if thisPdfObjectis of the typePdfStream.booleanisString()Deprecated.Checks if thisPdfObjectis of the typePdfString.intlength()Deprecated.Returns the length of the actual content of thePdfObject.protected voidsetContent(String content) Deprecated.Changes the content of thisPdfObject.voidsetIndRef(PRIndirectReference indRef) Deprecated.Set the indirect referencevoidtoPdf(PdfWriter writer, OutputStream os) Deprecated.Writes the PDF representation of thisPdfObjectas an array ofbytes to the writer.toString()Deprecated.Returns theString-representation of thisPdfObject.inttype()Deprecated.Returns the type of thisPdfObject.
-
Field Details
-
BOOLEAN
public static final int BOOLEANDeprecated.A possible type ofPdfObject- See Also:
-
NUMBER
public static final int NUMBERDeprecated.A possible type ofPdfObject- See Also:
-
STRING
public static final int STRINGDeprecated.A possible type ofPdfObject- See Also:
-
NAME
public static final int NAMEDeprecated.A possible type ofPdfObject- See Also:
-
ARRAY
public static final int ARRAYDeprecated.A possible type ofPdfObject- See Also:
-
DICTIONARY
public static final int DICTIONARYDeprecated.A possible type ofPdfObject- See Also:
-
STREAM
public static final int STREAMDeprecated.A possible type ofPdfObject- See Also:
-
NULL
public static final int NULLDeprecated.A possible type ofPdfObject- See Also:
-
INDIRECT
public static final int INDIRECTDeprecated.A possible type ofPdfObject- See Also:
-
NOTHING
Deprecated.An empty string used for thePdfNull-object and for an emptyPdfString-object.- See Also:
-
TEXT_PDFDOCENCODING
Deprecated.This is the default encoding to be used for converting Strings into bytes and vice versa. The default encoding is PdfDocEncoding.- See Also:
-
TEXT_UNICODE
Deprecated.This is the encoding to be used to output text in Unicode.- See Also:
-
bytes
protected byte[] bytesDeprecated.The content of thisPdfObject -
type
protected int typeDeprecated.The type of thisPdfObject -
indRef
Deprecated.Holds the indirect reference.
-
-
Constructor Details
-
PdfObject
protected PdfObject(int type) Deprecated.Constructs aPdfObjectof a certain type without any content.- Parameters:
type- type of the newPdfObject
-
PdfObject
Deprecated.Constructs aPdfObjectof a certain type with a certain content.- Parameters:
type- type of the newPdfObjectcontent- content of the newPdfObjectas aString.
-
PdfObject
protected PdfObject(int type, byte[] bytes) Deprecated.Constructs aPdfObjectof a certain type with a certain content.- Parameters:
type- type of the newPdfObjectbytes- content of the newPdfObjectas an array ofbyte.
-
-
Method Details
-
toPdf
Deprecated.Writes the PDF representation of thisPdfObjectas an array ofbytes to the writer.- Parameters:
writer- for backwards compatibilityos- TheOutputStreamto write the bytes to.- Throws:
IOException- on error
-
toString
Deprecated.Returns theString-representation of thisPdfObject. -
getBytes
public byte[] getBytes()Deprecated.Gets the presentation of this object in a byte array- Returns:
- a byte array
-
canBeInObjStm
public boolean canBeInObjStm()Deprecated.Whether this object can be contained in an object stream.PdfObjects of type STREAM OR INDIRECT can not be contained in an object stream.
- Returns:
trueif this object can be in an object stream. Otherwisefalse
-
length
public int length()Deprecated.Returns the length of the actual content of thePdfObject.In some cases, namely for
PdfStringandPdfStream, this method differs from the methodpdfLengthbecausepdfLengthreturns the length of the PDF representation of the object, not of the actual content as does the methodlength.Remark: the actual content of an object is in some cases identical to its representation. The following statement is always true: length() >= pdfLength().
- Returns:
- The length as
int
-
setContent
Deprecated.Changes the content of thisPdfObject.- Parameters:
content- the new content of thisPdfObject
-
type
public int type()Deprecated.Returns the type of thisPdfObject.May be either of: - NULL: A
PdfNull- BOOLEAN: APdfBoolean- NUMBER: APdfNumber- STRING: APdfString- NAME: APdfName- ARRAY: APdfArray- DICTIONARY: APdfDictionary- STREAM: APdfStream- INDIRECT: >PdfIndirectObject- Returns:
- The type
-
isNull
public boolean isNull()Deprecated.Checks if thisPdfObjectis of the typePdfNull.- Returns:
trueorfalse
-
isBoolean
public boolean isBoolean()Deprecated.Checks if thisPdfObjectis of the typePdfBoolean.- Returns:
trueorfalse
-
isNumber
public boolean isNumber()Deprecated.Checks if thisPdfObjectis of the typePdfNumber.- Returns:
trueorfalse
-
isString
public boolean isString()Deprecated.Checks if thisPdfObjectis of the typePdfString.- Returns:
trueorfalse
-
isName
public boolean isName()Deprecated.Checks if thisPdfObjectis of the typePdfName.- Returns:
trueorfalse
-
isArray
public boolean isArray()Deprecated.Checks if thisPdfObjectis of the typePdfArray.- Returns:
trueorfalse
-
isDictionary
public boolean isDictionary()Deprecated.Checks if thisPdfObjectis of the typePdfDictionary.- Returns:
trueorfalse
-
isStream
public boolean isStream()Deprecated.Checks if thisPdfObjectis of the typePdfStream.- Returns:
trueorfalse
-
isIndirect
public boolean isIndirect()Deprecated.Checks if thisPdfObjectis of the typePdfIndirectObject.- Returns:
trueif this is an indirect object, otherwisefalse
-
getIndRef
Deprecated.Get the indirect reference- Returns:
- A
PdfIndirectReference
-
setIndRef
Deprecated.Set the indirect reference- Parameters:
indRef- New value as aPdfIndirectReference
-