Skip to content

Commit

Permalink
PDFBOX-3345: use render destination instead of graphics device type b…
Browse files Browse the repository at this point in the history
…ecause that one can be a BufferedImage when printing with nonzero dpi

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922763 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 30, 2024
1 parent d857cfd commit b908fe5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1539,21 +1539,12 @@ public void shadingFill(COSName shadingName) throws IOException
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;
}
Expand Down

0 comments on commit b908fe5

Please sign in to comment.