Class CCITTFactory

java.lang.Object
org.sejda.sambox.pdmodel.graphics.image.CCITTFactory

public final class CCITTFactory extends Object
Factory for creating a PDImageXObject containing a CCITT Fax compressed TIFF image.
Author:
Ben Litchfield, Paul King
  • Method Details

    • createFromImage

      public static PDImageXObject createFromImage(BufferedImage image) throws IOException
      Creates a new CCITT group 4 (T6) compressed image XObject from a b/w BufferedImage. This compression technique usually results in smaller images than those produced by LosslessFactory#createFromImage(PDDocument, BufferedImage).
      Parameters:
      image - the image.
      Returns:
      a new image XObject.
      Throws:
      IOException - if there is an error creating the image.
      IllegalArgumentException - if the BufferedImage is not a b/w image.
    • createFromFile

      public static PDImageXObject createFromFile(File file) throws IOException
      Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.
      Parameters:
      file - the TIFF file which contains a suitable CCITT compressed image
      Returns:
      a new Image XObject
      Throws:
      IOException - if there is an error reading the TIFF data.
    • createFromFile

      public static PDImageXObject createFromFile(File file, int number) throws IOException
      Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.
      Parameters:
      file - the TIFF file which contains a suitable CCITT compressed image
      number - TIFF image number, starting from 0
      Returns:
      a new Image XObject
      Throws:
      IOException - if there is an error reading the TIFF data.
    • createFromSeekableSource

      public static PDImageXObject createFromSeekableSource(org.sejda.io.SeekableSource source) throws IOException
      Throws:
      IOException
    • createFromSeekableSource

      public static PDImageXObject createFromSeekableSource(org.sejda.io.SeekableSource source, int number) throws IOException
      Throws:
      IOException