I am calling Image.getInstance(myImage, null, true) and I am getting the following exception:

 

java.lang.ArrayIndexOutOfBoundsException

 

            at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown Source)

 

            at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown Source)

 

            at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown Source)

 

            at com.lowagie.text.Image.getInstance(Unknown Source)

 

            at com.lowagie.text.Image.getInstance(Unknown Source)

 

 

If I call the same method with false (as the last argument) it will run fine, but generate a huge PDF.  I have been using this method many times before and I just discovered this problem with certain TIFF files, while most TIFF files work. 

 

Furthermore, if I use example 11 from the iText site, I get the same exception.  However, example 12 works.  The problem is that I cannot use a byte array as in example 12 since I must alter an image in the form of a BufferedImage.

 

So how can I call getInstance with this image and have it work?  I guess I could try changing the image to a byte array and using the example in number 12, but how would I do that?

 

Thanks,

Aaron

 

Reply via email to