Class PDFXObject

  • All Implemented Interfaces:
    PDFWritable
    Direct Known Subclasses:
    PDFFormXObject, PDFImageXObject

    public abstract class PDFXObject
    extends AbstractPDFStream
    Abstract base class of PDF XObjects. A derivative of the PDF Object, is a PDF Stream that has not only a dictionary but a stream of image data. The dictionary just provides information like the stream length. This outputs the image dictionary and the image data. This is used as a reference for inserting the same image in the document in another place.
    • Constructor Detail

      • PDFXObject

        public PDFXObject()
        Create an XObject with the given number.
    • Method Detail

      • getName

        public PDFName getName()
        Returns the XObject's name.
        Returns:
        the name of the XObject
      • populateStreamDict

        protected void populateStreamDict​(java.lang.Object lengthEntry)
        Populates the dictionary with all necessary entries for the stream. Override this method if you need additional entries.
        Overrides:
        populateStreamDict in class AbstractPDFStream
        Parameters:
        lengthEntry - value for the /Length entry
      • getSizeHint

        protected int getSizeHint()
                           throws java.io.IOException
        Returns a value that hints at the size of the encoded stream. This is used to optimize buffer allocation so fewer buffer reallocations are necessary.
        Specified by:
        getSizeHint in class AbstractPDFStream
        Returns:
        an estimated size (0 if no hint can be given)
        Throws:
        java.io.IOException - in case of an I/O problem