Class JBIG2Decoder

java.lang.Object
org.jpedal.jbig2.JBIG2Decoder

public class JBIG2Decoder extends Object

JBIG2Decoder class.

  • Constructor Details

    • JBIG2Decoder

      public JBIG2Decoder()
      Constructor
  • Method Details

    • setGlobalData

      public void setGlobalData(byte[] data) throws JBIG2Exception
      If the data stream is taken from a PDF, there may be some global data. Pass any global data in here. Call this method before decodeJBIG2(...)
      Parameters:
      data - global data
      Throws:
      JBIG2Exception - if any.
    • decodeJBIG2

      public void decodeJBIG2(File file) throws IOException, JBIG2Exception
      Decodes a JBIG2 image from a File object
      Parameters:
      file - File to decode
      Throws:
      IOException - if any.
      JBIG2Exception - if any.
    • decodeJBIG2

      public void decodeJBIG2(String file) throws IOException, JBIG2Exception
      Decodes a JBIG2 image from a String path
      Parameters:
      file - Must be the full path to the image
      Throws:
      IOException - if any.
      JBIG2Exception - if any.
    • decodeJBIG2

      public void decodeJBIG2(InputStream inputStream) throws IOException, JBIG2Exception
      Decodes a JBIG2 image from an InputStream
      Parameters:
      inputStream - InputStream
      Throws:
      IOException - if any.
      JBIG2Exception - if any.
    • decodeJBIG2

      public void decodeJBIG2(byte[] data) throws IOException, JBIG2Exception
      Decodes a JBIG2 image from a byte array
      Parameters:
      data - the raw data stream
      Throws:
      IOException - if any.
      JBIG2Exception - if any.
    • getPageAsBufferedImage

      public BufferedImage getPageAsBufferedImage(int page)

      getPageAsBufferedImage.

      Parameters:
      page - a Integer object.
      Returns:
      a BufferedImage object.
    • isNumberOfPagesKnown

      public boolean isNumberOfPagesKnown()

      isNumberOfPagesKnown.

      Returns:
      a boolean.
    • getNumberOfPages

      public int getNumberOfPages()

      getNumberOfPages.

      Returns:
      a Integer object.
    • getAllSegments

      public List<Segment> getAllSegments()

      getAllSegments.

      Returns:
      a List object.
    • findPageSegement

      public PageInformationSegment findPageSegement(int page)

      findPageSegement.

      Parameters:
      page - a Integer object.
      Returns:
      a PageInformationSegment object.
    • findSegment

      public Segment findSegment(int segmentNumber)

      findSegment.

      Parameters:
      segmentNumber - a Integer object.
      Returns:
      a Segment object.
    • getPageAsJBIG2Bitmap

      public JBIG2Bitmap getPageAsJBIG2Bitmap(int page)

      getPageAsJBIG2Bitmap.

      Parameters:
      page - a Integer object.
      Returns:
      a JBIG2Bitmap object.
    • isRandomAccessOrganisationUsed

      public boolean isRandomAccessOrganisationUsed()

      isRandomAccessOrganisationUsed.

      Returns:
      a boolean.