Save This Page
Home » iText-2.1.7 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
abstract public class: PdfObject [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.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).

Field Summary
public static final  int BOOLEAN    A possible type of PdfObject 
public static final  int NUMBER    A possible type of PdfObject 
public static final  int STRING    A possible type of PdfObject 
public static final  int NAME    A possible type of PdfObject 
public static final  int ARRAY    A possible type of PdfObject 
public static final  int DICTIONARY    A possible type of PdfObject 
public static final  int STREAM    A possible type of PdfObject 
public static final  int NULL    A possible type of PdfObject 
public static final  int INDIRECT    A possible type of PdfObject 
public static final  String NOTHING    An empty string used for the PdfNull-object and for an empty PdfString-object. 
public static final  String TEXT_PDFDOCENCODING    This is the default encoding to be used for converting Strings into bytes and vice versa. The default encoding is PdfDocEncoding. 
public static final  String TEXT_UNICODE    This is the encoding to be used to output text in Unicode. 
protected  byte[] bytes    The content of this PdfObject 
protected  int type    The type of this PdfObject 
protected  PRIndirectReference indRef    Holds the indirect reference. 
Constructor:
 protected PdfObject(int type) 
 protected PdfObject(int type,
    String content) 
    Constructs a PdfObject of a certain type with a certain content.
    Parameters:
    type - type of the new PdfObject
    content - content of the new PdfObject as a String.
 protected PdfObject(int type,
    byte[] bytes) 
Method from com.lowagie.text.pdf.PdfObject Summary:
canBeInObjStm,   getBytes,   getIndRef,   isArray,   isBoolean,   isDictionary,   isIndirect,   isName,   isNull,   isNumber,   isStream,   isString,   length,   setContent,   setIndRef,   toPdf,   toString,   type
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.PdfObject Detail:
 public boolean canBeInObjStm() 
    Whether this object can be contained in an object stream. PdfObjects of type STREAM OR INDIRECT can not be contained in an object stream.
 public byte[] getBytes() 
    Gets the presentation of this object in a byte array
 public PRIndirectReference getIndRef() 
    Get the indirect reference
 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 PdfObject is of the type PdfIndirectObject.
 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.

    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) 
    Changes the content of this PdfObject.
 public  void setIndRef(PRIndirectReference indRef) 
    Set the indirect reference
 public  void toPdf(PdfWriter writer,
    OutputStream os) throws IOException 
    Writes the PDF representation of this PdfObject as an array of bytes to the writer.
 public String toString() 
    Returns the String-representation of this PdfObject.
 public int type() 
    Returns the type of this PdfObject. May be either of: - NULL: A PdfNull - BOOLEAN: A PdfBoolean - NUMBER: A PdfNumber - STRING: A PdfString - NAME: A PdfName - ARRAY: A PdfArray - DICTIONARY: A PdfDictionary - STREAM: A PdfStream - INDIRECT: >PdfIndirectObject