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

ArrayIndexOutOfBounds Exception when printing on Windows

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: PDModel
    • Labels:
      None
    • Environment:
      Windows Server 2003, Java 1.5.0.15

      Description

      When printing on Windows handling colors in DeviceGray doesn't correctly set the color values in PDColorState.java using JDK 1.5.0_15. The error doesn't occur using JDK 1.6.0_18

      This is a part of the message:

      23.03.2010 11:52:50 org.apache.pdfbox.util.PDFStreamEngine processOperator
      WARNUNG: java.lang.ArrayIndexOutOfBoundsException: 1
      java.lang.ArrayIndexOutOfBoundsException: 1
      at sun.awt.windows.WPrinterJob.setTextColor(Unknown Source)
      at sun.awt.windows.WPathGraphics.drawString(Unknown Source)
      at sun.awt.windows.WPathGraphics.drawString(Unknown Source)
      at org.apache.pdfbox.pdmodel.font.PDSimpleFont.writeFont(PDSimpleFont.java:350)
      at org.apache.pdfbox.pdmodel.font.PDType1Font.drawString(PDType1Font.java:248)
      at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:183)
      at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:494)
      at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:45)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:552)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:248)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:207)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:106)
      at org.apache.pdfbox.pdmodel.PDPage.print(PDPage.java:801)
      at sun.print.RasterPrinterJob.printPage(Unknown Source)
      at sun.print.RasterPrinterJob.print(Unknown Source)
      at sun.print.RasterPrinterJob.print(Unknown Source)
      at org.apache.pdfbox.pdmodel.PDDocument.print(PDDocument.java:993)
      at PrintPDF.main(PrintPDF.java:128)

        Attachments

        1. SubversionReference.pdf
          60 kB
          Maruan Sahyoun
        2. raw.pdf
          1 kB
          Maruan Sahyoun
        3. PDColorState.patch
          2 kB
          Maruan Sahyoun

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              msahyoun Maruan Sahyoun
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: