Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.2
-
Fix Version/s: 6.1.3
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
-
Workaround Exists:Yes
-
Workaround Description:
Description
When rendering the provided PDF file the following exceptions are thrown and the content of the PDF is rendered blank:
ICEsoft ICEpdf Viewer x.x.x x
Copyright ICEsoft Technologies, Inc.
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Catalog <clinit>
INFORMAZIONI: ICEsoft ICEpdf Core x.x.x x
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Resources getFont
AVVERTENZA: Error initializing font, falling back to font substitution.
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.AbstractContentParser consume_Tf
AVVERTENZA: Warning could not find font by named resource C2_0
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Resources getFont
AVVERTENZA: Error initializing font, falling back to font substitution.
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.AbstractContentParser consume_Tf
AVVERTENZA: Warning could not find font by named resource C2_0
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.NContentParser parse
AVVERTENZA: Error parsing content stream.
java.lang.NullPointerException
at org.icepdf.core.util.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:833)
at org.icepdf.core.util.content.NContentParser.parse(NContentParser.java:174)
at org.icepdf.core.pobjects.Page.init(Page.java:404)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1180)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
The problem is that the convertToString method of CMap.java class receives a CharSequence s of length 1.
P.S. Incidentally I noted that the same method contains a bug: if (s == null && s.length() % 2 != 0) I think should instead be if (s == null || s.length() % 2 != 0). But I don't think that is the problem.
ICEsoft ICEpdf Viewer x.x.x x
Copyright ICEsoft Technologies, Inc.
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Catalog <clinit>
INFORMAZIONI: ICEsoft ICEpdf Core x.x.x x
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Resources getFont
AVVERTENZA: Error initializing font, falling back to font substitution.
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.AbstractContentParser consume_Tf
AVVERTENZA: Warning could not find font by named resource C2_0
lug 15, 2016 10:03:01 AM org.icepdf.core.pobjects.Resources getFont
AVVERTENZA: Error initializing font, falling back to font substitution.
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.AbstractContentParser consume_Tf
AVVERTENZA: Warning could not find font by named resource C2_0
lug 15, 2016 10:03:01 AM org.icepdf.core.util.content.NContentParser parse
AVVERTENZA: Error parsing content stream.
java.lang.NullPointerException
at org.icepdf.core.util.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:833)
at org.icepdf.core.util.content.NContentParser.parse(NContentParser.java:174)
at org.icepdf.core.pobjects.Page.init(Page.java:404)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1180)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
The problem is that the convertToString method of CMap.java class receives a CharSequence s of length 1.
P.S. Incidentally I noted that the same method contains a bug: if (s == null && s.length() % 2 != 0) I think should instead be if (s == null || s.length() % 2 != 0). But I don't think that is the problem.
The file affected by the problem