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

NPE while printing a pdf with an image inside

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0-incubator
    • 1.0.0
    • Parsing
    • None

    Description

      Whenever a pdf is printed java uses a 2-pass-algo to create each page. The first pass using sun.print.PeekGraphics works fine, but during the second pass using sun.print.PSPathGraphics an exception occurs if the pdf includes an image.

      java.lang.NullPointerException
      at java.awt.geom.Area.<init>(Area.java:108)
      at sun.print.PSPathGraphics.drawImageToPlatform(PSPathGraphics.java:560)
      at sun.print.PathGraphics.drawImage(PathGraphics.java:1701)
      at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:121)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:516)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:229)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:188)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:99)
      at org.apache.pdfbox.pdmodel.PDPage.print(PDPage.java:795)
      at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1964)
      at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1431)
      at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1247)
      at org.apache.pdfbox.pdmodel.PDDocument.print(PDDocument.java:1003)

      Attachments

        1. MODULE17FHE38EX.pdf
          13 kB
          Andreas Lehmkühler

        Activity

          People

            Unassigned Unassigned
            lehmi Andreas Lehmkühler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: