You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2022/07/04 17:15:00 UTC
[jira] [Comment Edited] (PDFBOX-5471) NPE when Transparency Group is missing the BBox
[ https://issues.apache.org/jira/browse/PDFBOX-5471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17562251#comment-17562251 ]
Tilman Hausherr edited comment on PDFBOX-5471 at 7/4/22 5:14 PM:
-----------------------------------------------------------------
[~mkl] indeed! + done
[~henry-canva] thanks for the report!
snapshot at
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.27-SNAPSHOT/
was (Author: tilman):
[~mkl] indeed! + done
[~henry-canva] thanks for the report!
> NPE when Transparency Group is missing the BBox
> -----------------------------------------------
>
> Key: PDFBOX-5471
> URL: https://issues.apache.org/jira/browse/PDFBOX-5471
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.26
> Reporter: Henry Iguaro
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.27, 3.0.0 PDFBox
>
> Attachments: getbbox-null.pdf, image-2022-07-04-14-55-28-527.png
>
>
> Some files contain transparency groups with no {{{}BBox{}}}. When this happens, PDFBox rendering code throws a {{NullPointerException}} in the {{TransparencyGroup}} constructor:
>
> {code:java}
> // transform the bbox
> GeneralPath transformedBox = form.getBBox().transform(transform);
> \_______/
> NPE when its null{code}
> The following is a screenshot taken from {{pdf-debugger}} when trying to open a file with has this issue:
> !image-2022-07-04-14-55-28-527.png!
> The stack trace:
> {code:java}
> java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.apache.pdfbox.pdmodel.common.PDRectangle.transform(org.apache.pdfbox.util.Matrix)" because the return value of "org.apache.pdfbox.pdmodel.graphics.form.PDTransparencyGroup.getBBox()" is null
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:485)
> java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
> java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
> java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
> Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.apache.pdfbox.pdmodel.common.PDRectangle.transform(org.apache.pdfbox.util.Matrix)" because the return value of "org.apache.pdfbox.pdmodel.graphics.form.PDTransparencyGroup.getBBox()" is null
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:465)
> java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
> java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
> java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
> Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.pdfbox.pdmodel.common.PDRectangle.transform(org.apache.pdfbox.util.Matrix)" because the return value of "org.apache.pdfbox.pdmodel.graphics.form.PDTransparencyGroup.getBBox()" is null
> org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<init>(PageDrawer.java:1672)
> org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<init>(PageDrawer.java:1637)
> org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroupOnGraphics(PageDrawer.java:1575)
> org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroup(PageDrawer.java:1553)
> org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:81)
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:966)
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:541)
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:516)
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
> org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:279)
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:453)
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:435)
> java.base/java.lang.Thread.run(Thread.java:832)
> {code}
> The following is an example file that reproduces this problem:
> [^getbbox-null.pdf]
>
> A potential fix PR: https://github.com/apache/pdfbox/pull/145
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org