[ 
https://issues.apache.org/jira/browse/PDFBOX-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234482#comment-14234482
 ] 

Tilman Hausherr commented on PDFBOX-2423:
-----------------------------------------

The file http://www.pdflib.com/fileadmin/pdflib/Cookbook/pdf/color_gradient.pdf 
doesn't render:
{code}
java.lang.NullPointerException
        at org.apache.pdfbox.util.Matrix.concatenate(Matrix.java:195)
        at org.apache.pdfbox.util.Matrix.concatenate(Matrix.java:441)
        at org.apache.pdfbox.rendering.PageDrawer.getPaint(PageDrawer.java:242)
        at 
org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:498)
        at 
org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:346)
        at 
org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:306)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:760)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:719)
        at org.apache.pdfbox.rendering.PageDrawer.showText(PageDrawer.java:288)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.showTextStrings(PDFStreamEngine.java:629)
        at 
org.apache.pdfbox.contentstream.operator.text.ShowTextAdjusted.process(ShowTextAdjusted.java:38)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:829)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:497)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:463)
        at 
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:178)
        at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:163)
        at 
org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:213)
        at 
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:147)
        at 
org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:82)
        at 
org.apache.pdfbox.util.TestPDFToImage.doTestFile(TestPDFToImage.java:235)
        at 
org.apache.pdfbox.util.TestPDFToImage.testRenderImage(TestPDFToImage.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at junit.framework.TestSuite.runTest(TestSuite.java:255)
        at junit.framework.TestSuite.run(TestSuite.java:250)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:183)
        at junit.textui.TestRunner.main(TestRunner.java:137)
        at org.apache.pdfbox.util.TestPDFToImage.main(TestPDFToImage.java:404)
{code}
Likely because shadingPattern.getMatrix() can return null.

> Page tree handling needs rewriting
> ----------------------------------
>
>                 Key: PDFBOX-2423
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2423
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 1.8.7, 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>            Priority: Blocker
>             Fix For: 2.0.0
>
>         Attachments: 025957.pdf, 26101_Colors.ai-1.png, 
> 26101_Colors.ai-1.png-diff.png, Basiswissen-Vorschriften.pdf-3.png, 
> Basiswissen-Vorschriften.pdf-3.png-diff.png, 
> Basiswissen-Vorschriften.pdf-4.png, 
> Basiswissen-Vorschriften.pdf-4.png-diff.png, PDFBOX-1058.pdf-1.png, 
> PDFBOX-1058.pdf-1.png-diff.png, PDFBOX-1058.pdf-4.png, 
> PDFBOX-1058.pdf-4.png-diff.png, PDFBOX-1094-tiling_pattern.pdf, 
> PDFBOX-1711-cmyk.pdf-1.png, PDFBOX-1711-cmyk.pdf-1.png-diff.png, 
> PDFBOX-1794-vattenfall.pdf-1.png, PDFBOX-1794-vattenfall.pdf-1.png-diff.png, 
> PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, 
> asy-functionshading.pdf-1.png, asy-functionshading.pdf-1.png-diff.png, 
> bugzilla869140.pdf, example_026.pdf-1.png, gs-bugzilla694385.pdf, 
> jagpdf_doc_patterns.pdf
>
>
> The way in which PDFBox handles the Page tree needs to be rewritten, 
> preferably from scratch. Currently the document catalog returns the raw 
> objects from the page tree, wrapped in either a PDPage or PDPageNode.
> We need to abstract over the page tree and get rid of PDPageNode, we should 
> provide methods which can add/remove PDPage objects *only*. The existing 
> low-level access to the page tree is not needed at the PD-level.
> Inheritance of page properties such as crop box, resources, and rotation 
> should be reimplemented to use whatever new page tree abstraction we invent. 
> We can finally remove the old broken methods which didn't look up the 
> inheritance tree when retrieving these values.



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

Reply via email to