tags:

views:

143

answers:

1

I'm using PDFBox to try and print pdfs (we were using java's PDF Renderer, but ran into problems with CCITTFaxDecode compressed pdfs, so we switched). However, the pdfs are all printing as blank pages. When I step through the PDFBox code, I come across this code in PDCcitt.java:

    public BufferedImage getRGBImage() throws IOException
{
    BufferedImage retval = null;

    InputStream tiff = new TiffWrapper(
            getPDStream().getPartiallyFilteredStream( FAX_FILTERS ),
            getCOSStream());
    try 
    {
        retval = ImageIO.read(tiff);
    }
    catch (Exception e)
    {
        log.error(e, e);
    } 
    finally 
    {
        if (tiff != null)
        {
            tiff.close();
        }
    }
    return retval;
}

it is during the call to ImageIO.read() where this cryptic error is thrown: javax.imageio.IIOException: Error 2 I have no idea what this means, and have had a heck of a time trying to find it online. Can anyone help shed some light as to what this error refers to?

A: 

If you use Eclipse you could use the Jad + Jad Eclipse plugin to browse through decompiled code of the imageio jar. That would give you a pointer to start searching the reason of the error.

extraneon