Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 6.0
-
Fix Version/s: 6.0
-
Component/s: Font Engine
-
Labels:None
-
Environment:All
-
Salesforce Case Reference:
Description
The following NPE is thrown when trying to render the provided PDF file:
Oct 22, 2013 9:42:49 AM org.icepdf.core.pobjects.Resources getFont
WARNING: Error initializing font.
java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at org.icepdf.core.pobjects.fonts.nfont.b.f.read(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.b.f.read(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.b.f.readFully(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.i.readRaw(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.i.getTable(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.getCmap(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.deriveFont(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.Font.setEncoding(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.Font.init(Unknown Source)
at org.icepdf.core.pobjects.Resources.getFont(Resources.java:150)
at org.icepdf.core.util.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:722)
at org.icepdf.core.util.content.NContentParser.parseText(Unknown Source)
at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
at org.icepdf.core.pobjects.Form.init(Form.java:168)
at org.icepdf.core.pobjects.annotations.Annotation.init(Annotation.java:720)
at org.icepdf.core.pobjects.annotations.MarkupAnnotation.init(MarkupAnnotation.java:172)
at org.icepdf.core.pobjects.annotations.FreeTextAnnotation.init(FreeTextAnnotation.java:249)
at org.icepdf.core.pobjects.annotations.Annotation.buildAnnotation(Annotation.java:617)
at org.icepdf.core.util.Parser.getObject(Parser.java:427)
at org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
at org.icepdf.core.util.Library.getObject(Library.java:156)
at org.icepdf.core.pobjects.Page.initPageAnnotations(Page.java:286)
at org.icepdf.core.pobjects.Page.init(Page.java:338)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1064)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Oct 22, 2013 9:42:49 AM org.icepdf.core.pobjects.Resources getFont
WARNING: Error initializing font.
java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at org.icepdf.core.pobjects.fonts.nfont.b.f.read(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.b.f.read(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.b.f.readFully(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.i.readRaw(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.i.getTable(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.getCmap(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.deriveFont(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.Font.setEncoding(Unknown Source)
at org.icepdf.core.pobjects.fonts.nfont.Font.init(Unknown Source)
at org.icepdf.core.pobjects.Resources.getFont(Resources.java:150)
at org.icepdf.core.util.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:722)
at org.icepdf.core.util.content.NContentParser.parseText(Unknown Source)
at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
at org.icepdf.core.pobjects.Form.init(Form.java:168)
at org.icepdf.core.pobjects.annotations.Annotation.init(Annotation.java:720)
at org.icepdf.core.pobjects.annotations.MarkupAnnotation.init(MarkupAnnotation.java:172)
at org.icepdf.core.pobjects.annotations.FreeTextAnnotation.init(FreeTextAnnotation.java:249)
at org.icepdf.core.pobjects.annotations.Annotation.buildAnnotation(Annotation.java:617)
at org.icepdf.core.util.Parser.getObject(Parser.java:427)
at org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
at org.icepdf.core.util.Library.getObject(Library.java:156)
at org.icepdf.core.pobjects.Page.initPageAnnotations(Page.java:286)
at org.icepdf.core.pobjects.Page.init(Page.java:338)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1064)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
I've taken a high level look at this issue and the openType fonts in question have a null data source. I'll need to take closer look to verify if the embedded font is valid and go from there.
For the time being, font substitution is kicking in after the exception and the PDF appears to be rendering correctly despite the noisy logs.