pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Loiodice <loiod...@csdisco.com>
Subject Issue when rendering a pdf page as image
Date Thu, 18 Jan 2018 14:24:30 GMT
Hello,

I get an exception when I call

pdfRenderer.renderImageWithDPI(pageIndex, 300, ImageType.RGB);

on the 4th page (pageIndex 3) of the Pdf

https://www.dropbox.com/s/ut3ayyblsifsk36/my_inputfile.pdf?dl=0


This happens on a Amazon Linux instance (and not happening  on my dev
Mac machine) ...

I'm trying to run PdfBox on AWS lambda

so I can't make it work in the Amazon lambda environment.


The code works for thousands of other Pdf ... so this is the only case where

it fails for me.

This is the stack trace



java.awt.image.RasterFormatException: (y + height) is outside raster

        at sun.awt.image.IntegerInterleavedRaster.createWritableChild(
IntegerInterleavedRaster.java:470)

        at sun.awt.image.IntegerInterleavedRaster.createChild(
IntegerInterleavedRaster.java:514)

        at sun.java2d.pipe.GeneralCompositePipe.renderPathTile(
GeneralCompositePipe.java:106)

        at sun.java2d.pipe.AAShapePipe.renderTiles(AAShapePipe.java:201)

        at sun.java2d.pipe.AAShapePipe.renderPath(AAShapePipe.java:159)

        at sun.java2d.pipe.AAShapePipe.fill(AAShapePipe.java:68)

        at sun.java2d.pipe.PixelToParallelogramConverter.fill(
PixelToParallelogramConverter.java:164)

        at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:160)

        at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2527)

        at org.apache.pdfbox.rendering.PageDrawer.shadingFill(
PageDrawer.java:1144)

        at org.apache.pdfbox.contentstream.operator.
graphics.ShadingFill.process(ShadingFill.java:41)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(
PDFStreamEngine.java:838)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStreamOperators(PDFStreamEngine.java:495)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processTransparencyGroup(PDFStreamEngine.java:231)

        at org.apache.pdfbox.rendering.PageDrawer.access$1600(
PageDrawer.java:97)

        at org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<
init>(PageDrawer.java:1518)

        at org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<
init>(PageDrawer.java:1397)

        at org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroup(
PageDrawer.java:1339)

        at org.apache.pdfbox.contentstream.operator.
graphics.DrawObject.process(DrawObject.java:66)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(
PDFStreamEngine.java:838)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStreamOperators(PDFStreamEngine.java:495)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processTransparencyGroup(PDFStreamEngine.java:231)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.processSoftMask(
PDFStreamEngine.java:192)

        at org.apache.pdfbox.rendering.PageDrawer.access$1500(
PageDrawer.java:97)

        at org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<
init>(PageDrawer.java:1514)
        at org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<
init>(PageDrawer.java:1397)        at org.apache.pdfbox.rendering.
PageDrawer.applySoftMaskToPaint(PageDrawer.java:525)

        at org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroup(
PageDrawer.java:1381)

        at org.apache.pdfbox.contentstream.operator.
graphics.DrawObject.process(DrawObject.java:66)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(
PDFStreamEngine.java:838)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStreamOperators(PDFStreamEngine.java:495)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStream(PDFStreamEngine.java:469)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
showForm(PDFStreamEngine.java:179)

        at org.apache.pdfbox.contentstream.operator.
graphics.DrawObject.process(DrawObject.java:70)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(
PDFStreamEngine.java:838)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStreamOperators(PDFStreamEngine.java:495)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processStream(PDFStreamEngine.java:469)

        at org.apache.pdfbox.contentstream.PDFStreamEngine.
processPage(PDFStreamEngine.java:150)

        at org.apache.pdfbox.rendering.PageDrawer.drawPage(
PageDrawer.java:203)

        at org.apache.pdfbox.rendering.PDFRenderer.renderImage(
PDFRenderer.java:145)

        at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(
PDFRenderer.java:94)



This is the Java version where it does not work


openjdk version "1.8.0_151"

OpenJDK Runtime Environment (build 1.8.0_151-b12)

OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message