Package com.orsonpdf

Class PDFImage


  • public class PDFImage
    extends Stream
    Represents an image in a PDF document.
    • Field Detail

      • width

        int width
        The width.
      • height

        int height
        The height.
      • image

        java.awt.Image image
        The image.
      • softMaskImageRef

        java.lang.String softMaskImageRef
    • Constructor Detail

      • PDFImage

        public PDFImage​(int number,
                        java.awt.Image img,
                        java.lang.String softMaskImageRef)
        Creates a new image object.
        Parameters:
        number - the PDF object number.
        img - the AWT image object (null not permitted).
        softMaskImageRef - the soft mask image reference (null permitted).
    • Method Detail

      • getRawStreamData

        public byte[] getRawStreamData()
        Returns the raw image data. Each call will resample the image data and populate a new array. Note that the stream may encode this data before it is written to the PDF output.
        Specified by:
        getRawStreamData in class Stream
        Returns:
        The raw stream data.
      • createDictionary

        protected Dictionary createDictionary​(int streamLength)
        Creates a dictionary reflecting the current configuration for this image.
        Overrides:
        createDictionary in class Stream
        Parameters:
        streamLength - the stream length.
        Returns:
        A dictionary.