Class ImageLoader

java.lang.Object
com.lowagie.text.ImageLoader

public class ImageLoader extends Object
Loads image files such as PNG, JPEG, GIF, TIFF and BMP.

TODO: The goal of this class is to use Java ImageIO to parse images and metadata, and embed the image in the PDF in the best way (the compressed image format, not the raw pixels).

We don't want to maintain our own image codecs.

  • Constructor Details

    • ImageLoader

      public ImageLoader()
  • Method Details

    • getPngImage

      public static Image getPngImage(URL url)
      Creates an Image from a PNG image file in an URL.
      Parameters:
      url - url of the image
      Returns:
      an object of type Image
    • getGifImage

      public static Image getGifImage(URL url)
    • getTiffImage

      public static Image getTiffImage(URL url)
    • getBmpImage

      public static Image getBmpImage(URL url)
    • getJpegImage

      public static Image getJpegImage(URL url)
      Creates an Image from a JPEG image file in an URL.
      Parameters:
      url - url of the image
      Returns:
      an object of type Image
    • getJpeg2000Image

      public static Image getJpeg2000Image(URL url)
    • getGifImage

      public static Image getGifImage(byte[] imageData)
    • getPngImage

      public static Image getPngImage(byte[] imageData)
    • getBmpImage

      public static Image getBmpImage(byte[] imageData)
    • getTiffImage

      public static Image getTiffImage(byte[] imageData)
      Creates an Image from an array of tiff image bytes.
      Parameters:
      imageData - bytes of the tiff image
      Returns:
      an objet of type Image
    • getJpegImage

      public static Image getJpegImage(byte[] imageData)
      Creates an Image from a JPEG image file in a byte array.
      Parameters:
      imageData - bytes of the image
      Returns:
      an object of type Image
    • getJpeg2000Image

      public static Image getJpeg2000Image(byte[] imageData)