[ 
https://issues.apache.org/jira/browse/FOP-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner resolved FOP-2673.
--------------------------------
    Resolution: Not A Problem

> [PATCH] FOP-PDF-IMAGES add on throws NullPointerException
> ---------------------------------------------------------
>
>                 Key: FOP-2673
>                 URL: https://issues.apache.org/jira/browse/FOP-2673
>             Project: FOP
>          Issue Type: Bug
>          Components: renderer/pdf
>            Reporter: Eric Lim
>         Attachments: PDFBoxAdapter.java.patch, empty.pdf, simple-report.fo
>
>
> fop-pdf-images add-on throws an NPE when the source PDF is an empty PDF.  
> This issue started when fop upgraded to pdfbox 2.
> java.lang.NullPointerException
>       at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
>       at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
>       at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
>       at org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.getContents(Unknown 
> Source)
>       at 
> org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.createStreamFromPDFBoxPage(Unknown
>  Source)
>       at 
> org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createStreamForPDF(Unknown
>  Source)
>       at 
> org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(Unknown 
> Source)
>       at 
> org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
>       at 
> org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
>       at 
> org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
>       at 
> org.apache.fop.render.pdf.PDFPainter.drawImageUsingURI(PDFPainter.java:218)
>       at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:181)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1294)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1281)
>       at 
> org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
>       at 
> org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:862)
>       at 
> org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
>       at 
> org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
>       at 
> org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
>       at 
> org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
>       at 
> org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
>       at 
> org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:458)
>       at 
> org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:785)
>       at 
> org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:435)
>       at 
> org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:359)
>       at 
> org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:306)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
>       at 
> org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:271)
>       at 
> org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:244)
>       at 
> org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
>       at 
> org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
>       at 
> org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
>       at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:226)
>       at 
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:145)
>       at 
> org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
>       at 
> org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
>       at 
> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
>       at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
>       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
> Source)
>       at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>       at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>  Source)
>       at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
> Source)
>       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
> Source)
>       at 
> com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:59)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to