pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Buschtöns (JIRA) <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4581) Exception XRSurfaceData.getRaster not implemented yet on Swing, Linux
Date Fri, 28 Jun 2019 07:49:01 GMT

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

Jan Buschtöns commented on PDFBOX-4581:
---------------------------------------

I tried opening the PDF in PDFDebugger and there is no problem. Does PDFDebugger render into
a BufferedImage?

In my application, drawing into a BufferedImage and then drawing the buffered image on to
swing is a tested workaround. I assume that's not the most efficient way to in a paint method.
But I probaly should change the code to prerender the PDF in to a BufferedImage once (or every
time the size/dpi changes) and then just use that BufferedImage in the paint method. In fact,
there already is an option in my application to do something like this, it's just very broken.

I'm not sure if it's ever a good idea to render a PDF directly in a swing Graphics object
instead of prerendering it.

In my application I currently use a different PDF renderer. That one doesn't handle transparency
correct, either. It's drawn, but wrong. I'm not aware that any user ever complained or noticed.
I don't think it's something that's used very much for certain types of documents. Not seeing
the transparency group would probably be much better than an exception.

> Exception XRSurfaceData.getRaster not implemented yet on Swing, Linux
> ---------------------------------------------------------------------
>
>                 Key: PDFBOX-4581
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4581
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.15
>         Environment: Ubuntu 18.04.2 LTS
>            Reporter: Jan Buschtöns
>            Priority: Major
>         Attachments: notYetImplemented_PDFBox_FORMGEN-2185-master.zip
>
>
> When trying to render certain PDFs on a swing Graphics object, I get the following Exception
on Linux:
> {code:java}
> Exception in thread "AWT-EventQueue-0" java.lang.InternalError: not implemented yet
> at java.desktop/sun.java2d.xr.XRSurfaceData.getRaster(XRSurfaceData.java:91)
> at java.desktop/sun.java2d.loops.Blit$AnyBlit.Blit(Blit.java:163)
> at java.desktop/sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:972)
> at java.desktop/sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:583)
> at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:67)
> at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1027)
> at java.desktop/sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:186)
> at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3415)
> at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3545)
> at org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroup(PageDrawer.java:1570)
> at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:66)
> at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:869)
> at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:505)
> at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:479)
> at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:152)
> at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:265)
> at org.apache.pdfbox.rendering.PDFRenderer.renderPageToGraphics(PDFRenderer.java:401)
> at org.apache.pdfbox.rendering.PDFRenderer.renderPageToGraphics(PDFRenderer.java:370)
> at org.apache.pdfbox.rendering.PDFRenderer.renderPageToGraphics(PDFRenderer.java:355)
> at org.apache.pdfbox.rendering.PDFRenderer.renderPageToGraphics(PDFRenderer.java:342)
> at de.abm.bug.App$PDFView.paint(App.java:29)
> at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
> at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
> at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
> at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
> at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
> at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
> at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5262)
> at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
> at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
> at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
> at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
> at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
> at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
> at java.desktop/java.awt.Container.paint(Container.java:2002)
> at java.desktop/java.awt.Window.paint(Window.java:3940)
> at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
> at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
> at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
> at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
> at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
> at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890)
> at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
> at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
> at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
> at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
> at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
> at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
> at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
> at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
> at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
> at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
> at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
> {code}
> This does not happen on Windows 10.
> The same exception came up in the comments to PDFBOX-2905.
> Seems to be the same problem as in [JDK-6689349.|https://bugs.openjdk.java.net/browse/JDK-6689349]

> I reproduced this with PDFBox 2.0.13, 2.0.15 and 3.0.0-SNAPSHOT. And also with an oracle
jdk.1.8.0_201, open jdk 1.8.0_212 and open jdk 11.0.1.
> I've attached an example maven project using the same PDF as in PDFBOX-2905.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message