Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3285

All lines that use a given font stop rendering if 'ö' is inserted - ArrayIndexOutOfBoundsException in TTFSubFont.buildPostTable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.12
    • 1.8.12
    • Rendering
    • None
    • Fedora 23

    Description

      When using a couple of different Courier fonts, if I insert the character 'ö' into a line of the pdf any other line that uses the same font will no longer display. Other styles of the same font still work fine.

      Example file:

      http://s000.tinyupload.com/?file_id=72100196724522466317

      This happens in 1.8.8, 1.8.11, and the unreleased 1.8.12 but does not happen in 2.0.0. To display the PDF I've been using the pdfbox app jars for the respective versions which gives the following error:

      Mar 22, 2016 11:52:58 AM org.apache.pdfbox.util.PDFStreamEngine processOperator
      WARNING: java.lang.ArrayIndexOutOfBoundsException: 18
      java.lang.ArrayIndexOutOfBoundsException: 18
      at org.apache.fontbox.ttf.TTFSubFont.buildPostTable(TTFSubFont.java:969)
      at org.apache.fontbox.ttf.TTFSubFont.writeToStream(TTFSubFont.java:1131)
      at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.rebuildTTF(PDTrueTypeFont.java:556)
      at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getawtFont(PDTrueTypeFont.java:478)
      at org.apache.pdfbox.pdmodel.font.PDSimpleFont.drawString(PDSimpleFont.java:110)
      at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:260)
      at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:504)
      at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:56)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:562)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:269)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:236)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:216)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:139)
      at org.apache.pdfbox.pdfviewer.PDFPagePanel.paint(PDFPagePanel.java:121)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JViewport.paint(JViewport.java:728)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paint(JComponent.java:1065)
      at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
      at javax.swing.JComponent.paintChildren(JComponent.java:889)
      at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217)
      at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:290)
      at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
      at javax.swing.JComponent.paint(JComponent.java:1042)
      at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
      at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:79)
      at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:116)
      at java.awt.Container.paint(Container.java:1975)
      at java.awt.Window.paint(Window.java:3912)
      at javax.swing.RepaintManager$4.run(RepaintManager.java:842)
      at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
      at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
      at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
      at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
      at java.awt.EventQueue.access$500(EventQueue.java:97)
      at java.awt.EventQueue$3.run(EventQueue.java:709)
      at java.awt.EventQueue$3.run(EventQueue.java:703)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            sclark Samuel Clark
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: