You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (JIRA)" <ji...@apache.org> on 2010/03/30 12:52:28 UTC

[jira] Created: (PDFBOX-674) ArrayIndexOutOfBounds Exception when printing on Windows

ArrayIndexOutOfBounds Exception when printing on Windows
--------------------------------------------------------

                 Key: PDFBOX-674
                 URL: https://issues.apache.org/jira/browse/PDFBOX-674
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
         Environment: Windows Server 2003, Java 1.5.0.15
            Reporter: Maruan Sahyoun


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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-674) ArrayIndexOutOfBounds Exception when printing on Windows

Posted by "Maruan Sahyoun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maruan Sahyoun updated PDFBOX-674:
----------------------------------

    Attachment: SubversionReference.pdf
                raw.pdf

Testfiles to reproduce the error 

> ArrayIndexOutOfBounds Exception when printing on Windows
> --------------------------------------------------------
>
>                 Key: PDFBOX-674
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-674
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>         Environment: Windows Server 2003, Java 1.5.0.15
>            Reporter: Maruan Sahyoun
>         Attachments: PDColorState.patch, raw.pdf, SubversionReference.pdf
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-674) ArrayIndexOutOfBounds Exception when printing on Windows

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-674.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.0

I've applied the patch (slightly rearranged) with version 929209.

Thanks to Maruan for the contribution.

> ArrayIndexOutOfBounds Exception when printing on Windows
> --------------------------------------------------------
>
>                 Key: PDFBOX-674
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-674
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>         Environment: Windows Server 2003, Java 1.5.0.15
>            Reporter: Maruan Sahyoun
>             Fix For: 1.2.0
>
>         Attachments: PDColorState.patch, raw.pdf, SubversionReference.pdf
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-674) ArrayIndexOutOfBounds Exception when printing on Windows

Posted by "Maruan Sahyoun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maruan Sahyoun updated PDFBOX-674:
----------------------------------

    Attachment: PDColorState.patch

Patch to resolve the handling of DeviceGray on Windows Server 2003 and JVM 1.5.0_15 (PDColorState.patch)



> ArrayIndexOutOfBounds Exception when printing on Windows
> --------------------------------------------------------
>
>                 Key: PDFBOX-674
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-674
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>         Environment: Windows Server 2003, Java 1.5.0.15
>            Reporter: Maruan Sahyoun
>         Attachments: PDColorState.patch
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.