Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 4.1.1
-
Fix Version/s: 4.1.3
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
Description
The following exception is thrown when trying to display PDF:
Nov 23, 2010 11:14:23 AM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: I1
java.lang.RuntimeException: Invalid code encountered.
at org.icepdf.core.pobjects.filters.CCITTFaxDecoder.decodeNextScanline(CCITTFaxDecoder.java:704)
at org.icepdf.core.pobjects.filters.CCITTFaxDecoder.decodeT41D(CCITTFaxDecoder.java:822)
at org.icepdf.core.pobjects.Stream.ccittFaxDecode(Stream.java:1675)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1966)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1854)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:261)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:477)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
This is thrown for each image in the pdf. The images are not shown on the page or they are shown in black.
Nov 23, 2010 11:14:23 AM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: I1
java.lang.RuntimeException: Invalid code encountered.
at org.icepdf.core.pobjects.filters.CCITTFaxDecoder.decodeNextScanline(CCITTFaxDecoder.java:704)
at org.icepdf.core.pobjects.filters.CCITTFaxDecoder.decodeT41D(CCITTFaxDecoder.java:822)
at org.icepdf.core.pobjects.Stream.ccittFaxDecode(Stream.java:1675)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1966)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:1854)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:261)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:477)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
This is thrown for each image in the pdf. The images are not shown on the page or they are shown in black.
I was able to reproduce the error message. For some reason IText isn't putting in decode param for the CCITTFax image. By default the k=0 which specifies a T4 1D fax format. However the image streams appears to be encode using k = -1 which T6 encoding.
I'm going to attach a patch that addresses the issue in that it get the PDF to render. Before the next release I'll take another look as there maybe a image header that we can use to figure out the k value more reliably.