Class PdfObject
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
PdfObject is the abstract baseclass of all PDF objects. PDF supports seven basic types of objects: bools, 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 PdfNull @see Pdfbool @see PdfNumber @see PdfString @see PdfName @see PdfArray @see PdfDictionary @see PdfStream @see PdfIndirectReference
public abstract class PdfObject
- Inheritance
-
PdfObject
- Derived
- Inherited Members
Constructors
PdfObject(int)
constructors
protected PdfObject(int type)
Parameters
type
inttype of the new PdfObject
PdfObject(int, byte[])
Constructs a PdfObject of a certain type with a certain content.
protected PdfObject(int type, byte[] bytes)
Parameters
PdfObject(int, string)
Constructs a PdfObject of a certain type with a certain content.
protected PdfObject(int type, string content)
Parameters
Fields
ARRAY
static membervariables (all the possible types of a PdfObject)
public const int ARRAY = 5
Field Value
BOOLEAN
a possible type of PdfObject
public const int BOOLEAN = 1
Field Value
Bytes
membervariables
protected byte[] Bytes
Field Value
- byte[]
DICTIONARY
a possible type of PdfObject
public const int DICTIONARY = 6
Field Value
INDIRECT
a possible type of PdfObject
public const int INDIRECT = 10
Field Value
NAME
a possible type of PdfObject
public const int NAME = 4
Field Value
NOTHING
This is an empty string used for the PdfNull -object and for an empty PdfString -object.
public const string NOTHING = ""
Field Value
NULL
a possible type of PdfObject
public const int NULL = 8
Field Value
NUMBER
a possible type of PdfObject
public const int NUMBER = 2
Field Value
STREAM
a possible type of PdfObject
public const int STREAM = 7
Field Value
STRING
a possible type of PdfObject
public const int STRING = 3
Field Value
TEXT_PDFDOCENCODING
This is the default encoding to be used for converting strings into bytes and vice versa. The default encoding is PdfDocEcoding.
public const string TEXT_PDFDOCENCODING = "PDF"
Field Value
TEXT_UNICODE
This is the encoding to be used to output text in Unicode.
public const string TEXT_UNICODE = "UnicodeBig"
Field Value
indRef
Holds value of property indRef.
protected PrIndirectReference indRef
Field Value
type
the type of this PdfObject
protected int type
Field Value
Properties
Content
protected string Content { set; }
Property Value
IndRef
public PrIndirectReference IndRef { get; set; }
Property Value
Length
public int Length { get; }
Property Value
Type
public int Type { get; }
Property Value
Methods
CanBeInObjStm()
Can this object be in an object stream?
public bool CanBeInObjStm()
Returns
- bool
true if this object can be in an object stream.
GetBytes()
Gets the presentation of this object in a byte array
public virtual byte[] GetBytes()
Returns
- byte[]
a byte array
IsArray()
public bool IsArray()
Returns
IsBoolean()
public bool IsBoolean()
Returns
IsDictionary()
public bool IsDictionary()
Returns
IsIndirect()
Checks if this is an indirect object.
public bool IsIndirect()
Returns
- bool
true if this is an indirect object
IsName()
public bool IsName()
Returns
IsNull()
public bool IsNull()
Returns
IsNumber()
public bool IsNumber()
Returns
IsStream()
public bool IsStream()
Returns
IsString()
public bool IsString()
Returns
ToPdf(PdfWriter, Stream)
public virtual void ToPdf(PdfWriter writer, Stream os)
Parameters
ToString()
Returns the length of the PDF representation of the PdfObject . In some cases, namely for PdfString and PdfStream , this method differs from the method length because length returns the length of the actual content of the PdfObject . Remark: the actual content of an object is in most cases identical to its representation. The following statement is always true: Length() >= PdfLength().
public override string ToString()
Returns
- string
a length