Class PDJpeg

    • Constructor Detail

      • PDJpeg

        public PDJpeg​(PDStream jpeg)
        Standard constructor.
        Parameters:
        jpeg - The COSStream from which to extract the JPeg
      • PDJpeg

        public PDJpeg​(PDDocument doc,
                      java.io.InputStream is)
               throws java.io.IOException
        Construct from a stream.
        Parameters:
        doc - The document to create the image as part of.
        is - The stream that contains the jpeg data.
        Throws:
        java.io.IOException - If there is an error reading the jpeg data.
      • PDJpeg

        public PDJpeg​(PDDocument doc,
                      java.awt.image.BufferedImage bi)
               throws java.io.IOException
        Construct from a buffered image. The default compression level of 0.75 will be used.
        Parameters:
        doc - The document to create the image as part of.
        bi - The image to convert to a jpeg
        Throws:
        java.io.IOException - If there is an error processing the jpeg data.
      • PDJpeg

        public PDJpeg​(PDDocument doc,
                      java.awt.image.BufferedImage bi,
                      float compressionQuality)
               throws java.io.IOException
        Construct from a buffered image.
        Parameters:
        doc - The document to create the image as part of.
        bi - The image to convert to a jpeg
        compressionQuality - The quality level which is used to compress the image
        Throws:
        java.io.IOException - If there is an error processing the jpeg data.
    • Method Detail

      • getRGBImage

        public java.awt.image.BufferedImage getRGBImage()
                                                 throws java.io.IOException
        Returns an image of the JPeg, or null if JPegs are not supported. (They should be. ) Returns an java.awt.Image, that can be used for display etc.
        Specified by:
        getRGBImage in class PDXObjectImage
        Returns:
        A Jpeg image.
        Throws:
        java.io.IOException
      • write2OutputStream

        public void write2OutputStream​(java.io.OutputStream out)
                                throws java.io.IOException
        This writes the JPeg to out. Writes the Image to out.
        Specified by:
        write2OutputStream in class PDXObjectImage
        Parameters:
        out - the OutputStream that the Image is written to.
        Throws:
        java.io.IOException - when somethings wrong with out
      • clear

        public void clear()
        Description copied from class: PDXObject
        Calling this will release all cached information.
        Overrides:
        clear in class PDXObject