Package pdf

Class PDFObject

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int objser
      This is the unique serial number for this object.
      protected PDFDocument pdfDocument
      This allows any PDF object to refer to the document being constructed.
    • Constructor Summary

      Constructors 
      Constructor Description
      PDFObject​(java.lang.String type)
      This is usually called by extensors to this class, and sets the PDF Object Type
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      PDFDocument getPDFDocument()
      Returns the PDF document this object belongs to.
      int getSerialID()
      Returns the unique serial number of this object.
      java.lang.String getType()
      Returns the PDF Type of this object
      static java.lang.String toArray​(java.util.Vector<? extends PDFObject> v)
      This utility method returns a String containing an array definition based on a Vector containing PDFObjects
      java.lang.String toString()
      Returns the unique serial number in PDF format
      abstract void write​(java.io.OutputStream os)
      Writes the object to the output stream.
      void writeEnd​(java.io.OutputStream os)
      The write method should call this after writing anything to the OutputStream.
      void writeStart​(java.io.OutputStream os)
      The write method should call this before writing anything to the OutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • objser

        protected int objser
        This is the unique serial number for this object.
      • pdfDocument

        protected PDFDocument pdfDocument
        This allows any PDF object to refer to the document being constructed.
    • Constructor Detail

      • PDFObject

        public PDFObject​(java.lang.String type)
        This is usually called by extensors to this class, and sets the PDF Object Type
        Parameters:
        type - the PDF Object Type
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns the PDF Type of this object
        Returns:
        The PDF Type of this object
      • getSerialID

        public final int getSerialID()
        Returns the unique serial number of this object.
        Returns:
        Unique serial number of this object.
      • getPDFDocument

        public final PDFDocument getPDFDocument()
        Returns the PDF document this object belongs to.
        Returns:
        PDF containing this object
      • write

        public abstract void write​(java.io.OutputStream os)
                            throws java.io.IOException

        Writes the object to the output stream. This method must be overidden.

        Note: It should not write any other objects, even if they are it's Kids, as they will be written by the calling routine.

        Parameters:
        os - OutputStream to send the object to
        Throws:
        java.io.IOException - on error
      • writeStart

        public final void writeStart​(java.io.OutputStream os)
                              throws java.io.IOException
        The write method should call this before writing anything to the OutputStream. This will send the standard header for each object.

        Note: There are a few rare cases where this method is not called.

        Parameters:
        os - OutputStream to write to
        Throws:
        java.io.IOException - on error
      • writeEnd

        public final void writeEnd​(java.io.OutputStream os)
                            throws java.io.IOException
        The write method should call this after writing anything to the OutputStream. This will send the standard footer for each object.

        Note: There are a few rare cases where this method is not called.

        Parameters:
        os - OutputStream to write to
        Throws:
        java.io.IOException - on error
      • toString

        public java.lang.String toString()
        Returns the unique serial number in PDF format
        Overrides:
        toString in class java.lang.Object
        Returns:
        the serial number in PDF format
      • toArray

        public static java.lang.String toArray​(java.util.Vector<? extends PDFObject> v)
        This utility method returns a String containing an array definition based on a Vector containing PDFObjects
        Parameters:
        v - Vector containing PDFObjects
        Returns:
        String containing a PDF array