You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Matthew Pangaro (JIRA)" <ji...@apache.org> on 2009/02/18 19:26:01 UTC

[jira] Created: (PDFBOX-427) ArrayIndexOutOfBoundsException in drawString

ArrayIndexOutOfBoundsException in drawString
--------------------------------------------

                 Key: PDFBOX-427
                 URL: https://issues.apache.org/jira/browse/PDFBOX-427
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 0.8.0-incubator
         Environment: 1.4.2_07 and 1.5.0_17
            Reporter: Matthew Pangaro


I'm getting the error stack below when printing out a test PDF from my application. Since the error is coming from within the sun.awt stuff, I'm somewhat at a loss for how to debug. This doesn't seem to stop the PDF from rendering/printing, but the fonts on the page do look messed up, so I'm trying to work through stuff and see if there's anything I can fix/improve/patch. Another thing worth noting is that this exception occurs in 1.4.2_07 (don't ask) and 1.5.0_17, but not 1.6.0_x. Also worth noting is that even with the 1.6 not giving the error, the rendering doesn't improve, so maybe this isn't something I don't need to worry about.

Stack trace below and a sample PDF will be attached after creating the issue.

SEVERE: Error writing string :  
Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
SEVERE: At coordinates : 609.93475 : 778.9607
Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
SEVERE: G2 bounds : java.awt.Rectangle[x=0,y=0,width=612,height=792]
Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
SEVERE: Font : java.awt.Font[family=Times New Roman,name=Times New Roman,style=plain,size=1]
Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
SEVERE: With exception : 1
java.lang.ArrayIndexOutOfBoundsException: 1
	at sun.awt.windows.WPrinterJob.setTextColor(WPrinterJob.java:946)
	at sun.awt.windows.WPathGraphics.drawString(WPathGraphics.java:376)
	at org.apache.pdfbox.pdmodel.font.PDType1Font.drawString(PDType1Font.java:232)
	at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:172)
	at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:442)
	at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:50)
	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:491)
	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:214)
	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:173)
	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:89)
	at org.apache.pdfbox.pdmodel.PDPage.print(PDPage.java:764)
	at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1538)
	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1110)
	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1011)
	at org.apache.pdfbox.pdmodel.PDDocument.silentPrint(PDDocument.java:886)
	at TestPdfPrintOptions.main(TestPdfPrintOptions.java:34)


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


[jira] Updated: (PDFBOX-427) ArrayIndexOutOfBoundsException in drawString

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

Matthew Pangaro updated PDFBOX-427:
-----------------------------------

    Attachment: test3.pdf

Sample PDF for this error. Will also be used for several others. From the CollabNet Subversion reference card.

> ArrayIndexOutOfBoundsException in drawString
> --------------------------------------------
>
>                 Key: PDFBOX-427
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-427
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 0.8.0-incubator
>         Environment: 1.4.2_07 and 1.5.0_17
>            Reporter: Matthew Pangaro
>         Attachments: test3.pdf
>
>
> I'm getting the error stack below when printing out a test PDF from my application. Since the error is coming from within the sun.awt stuff, I'm somewhat at a loss for how to debug. This doesn't seem to stop the PDF from rendering/printing, but the fonts on the page do look messed up, so I'm trying to work through stuff and see if there's anything I can fix/improve/patch. Another thing worth noting is that this exception occurs in 1.4.2_07 (don't ask) and 1.5.0_17, but not 1.6.0_x. Also worth noting is that even with the 1.6 not giving the error, the rendering doesn't improve, so maybe this isn't something I don't need to worry about.
> Stack trace below and a sample PDF will be attached after creating the issue.
> SEVERE: Error writing string :  
> Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
> SEVERE: At coordinates : 609.93475 : 778.9607
> Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
> SEVERE: G2 bounds : java.awt.Rectangle[x=0,y=0,width=612,height=792]
> Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
> SEVERE: Font : java.awt.Font[family=Times New Roman,name=Times New Roman,style=plain,size=1]
> Feb 18, 2009 1:22:24 PM org.apache.pdfbox.pdmodel.font.PDType1Font drawString
> SEVERE: With exception : 1
> java.lang.ArrayIndexOutOfBoundsException: 1
> 	at sun.awt.windows.WPrinterJob.setTextColor(WPrinterJob.java:946)
> 	at sun.awt.windows.WPathGraphics.drawString(WPathGraphics.java:376)
> 	at org.apache.pdfbox.pdmodel.font.PDType1Font.drawString(PDType1Font.java:232)
> 	at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:172)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:442)
> 	at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:50)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:491)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:214)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:173)
> 	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:89)
> 	at org.apache.pdfbox.pdmodel.PDPage.print(PDPage.java:764)
> 	at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1538)
> 	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1110)
> 	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1011)
> 	at org.apache.pdfbox.pdmodel.PDDocument.silentPrint(PDDocument.java:886)
> 	at TestPdfPrintOptions.main(TestPdfPrintOptions.java:34)

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