You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2024/12/30 08:58:07 UTC

svn commit: r1922761 - /pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Author: tilman
Date: Mon Dec 30 08:58:07 2024
New Revision: 1922761

URL: http://svn.apache.org/viewvc?rev=1922761&view=rev
Log:
PDFBOX-3345: use render destination instead of graphics device type because that one can be a BufferedImage when printing with nonzero dpi

Modified:
    pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1922761&r1=1922760&r2=1922761&view=diff
==============================================================================
--- pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Mon Dec 30 08:58:07 2024
@@ -1540,21 +1540,12 @@ public class PageDrawer extends PDFGraph
     public void showAnnotation(PDAnnotation annotation) throws IOException
     {
         lastClips = null;
-        int deviceType = -1;
-        GraphicsConfiguration graphicsConfiguration = graphics.getDeviceConfiguration();
-        if (graphicsConfiguration != null)
-        {
-            GraphicsDevice graphicsDevice = graphicsConfiguration.getDevice();
-            if (graphicsDevice != null)
-            {
-                deviceType = graphicsDevice.getType();
-            }
-        }
-        if (deviceType == GraphicsDevice.TYPE_PRINTER && !annotation.isPrinted())
+        if (destination == RenderDestination.PRINT && !annotation.isPrinted())
         {
             return;
         }
-        if (deviceType == GraphicsDevice.TYPE_RASTER_SCREEN && annotation.isNoView())
+        if ((destination == RenderDestination.VIEW || destination == RenderDestination.EXPORT) &&
+                annotation.isNoView())
         {
             return;
         }