ICEpdf
  1. ICEpdf
  2. PDF-656

InvocationTargetException - Could not load font dictionary class

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.3
    • Fix Version/s: 5.0.4
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All
    • Salesforce Case Reference:

      Description

      When rendering a provided PDF file the following error strack trace is thrown and the PDF is rendered with mixed up characters. According to the customer the file uses built in CID fonts with Identity-H encoding:

      FINE: Could not load font dictionary class
      java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      at org.icepdf.core.pobjects.fonts.FontFactory.getFont(FontFactory.java:126)
      at org.icepdf.core.util.Parser.getObject(Parser.java:411)
      at org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
      at org.icepdf.core.util.Library.getObject(Library.java:156)
      at org.icepdf.core.util.Library.getObject(Library.java:206)
      at org.icepdf.core.pobjects.fonts.nfont.Font.init(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.Page.init(Page.java:368)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1039)
      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)
      Caused by: java.lang.NullPointerException
      at org.icepdf.core.pobjects.fonts.Font.<init>(Font.java:195)
      at org.icepdf.core.pobjects.fonts.nfont.Font.<init>(Unknown Source)
      ... 19 more

        Activity

        Hide
        Patrick Corless added a comment -

        The issue with this PDF is the that a font's fontDescriptor has a dictionary type entry that specifies it as a "font" instead of "fontDescriptor". As a result our Font class chokes when trying to initialize a fontDescriptor as a font.

        Show
        Patrick Corless added a comment - The issue with this PDF is the that a font's fontDescriptor has a dictionary type entry that specifies it as a "font" instead of "fontDescriptor". As a result our Font class chokes when trying to initialize a fontDescriptor as a font.
        Hide
        Patrick Corless added a comment -

        Tweaked the parser to sniff out the fontDescriptor even with the type=font. Fix has been added to trunk and branch.

        Show
        Patrick Corless added a comment - Tweaked the parser to sniff out the fontDescriptor even with the type=font. Fix has been added to trunk and branch.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: