javax.imageio.IIOException:在 PDFBox 中打印使用 CCITTFaxDecode 压缩的 PDF 时出现错误 2
我正在使用 PDFBox 尝试打印 pdf(我们使用的是 java 的 PDF 渲染器,但遇到了 CCITTFaxDecode 压缩 pdf 的问题,因此我们进行了切换)。但是,pdf 全部打印为空白页。当我单步执行 PDFBox 代码时,我在 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;
}
在调用 ImageIO.read() 期间抛出了这个神秘的错误: javax.imageio.IIOException:错误 2 我不知道这意味着什么,并且花了很长时间试图在网上找到它。任何人都可以帮助阐明这个错误指的是什么吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Eclipse,则可以使用 Jad + Jad Eclipse 插件来浏览 imageio jar 的反编译代码。这将为您提供开始搜索错误原因的指针。
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.