ICEpdf
  1. ICEpdf
  2. PDF-669

NullPointerException at arraycopy

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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)

        Activity

        Hide
        Patrick Corless added a comment -

        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.

        Show
        Patrick Corless added a comment - 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.
        Hide
        Patrick Corless added a comment -

        Lowering the logging level to be little less verbose when encountering at found loading issue. By default only light warning message will appear. If logging is at "finner" then a full stack trace will be logged.

        Show
        Patrick Corless added a comment - Lowering the logging level to be little less verbose when encountering at found loading issue. By default only light warning message will appear. If logging is at "finner" then a full stack trace will be logged.
        Hide
        Patrick Corless added a comment -

        I'll take another look at this later to see if the font loading issue can be fixed.

        Show
        Patrick Corless added a comment - I'll take another look at this later to see if the font loading issue can be fixed.
        Hide
        Patrick Corless added a comment -

        Marking as fixed, debug level has been lowered.

        Show
        Patrick Corless added a comment - Marking as fixed, debug level has been lowered.
        Hide
        Patrick Corless added a comment -

        Marking as closed

        Show
        Patrick Corless added a comment - Marking as closed

          People

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

            Dates

            • Created:
              Updated:
              Resolved: