Skip to content

Commit b908fe5

Browse files
committed
PDFBOX-3345: use render destination instead of graphics device type because 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
1 parent d857cfd commit b908fe5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,21 +1539,12 @@ public void shadingFill(COSName shadingName) throws IOException
15391539
public void showAnnotation(PDAnnotation annotation) throws IOException
15401540
{
15411541
lastClips = null;
1542-
int deviceType = -1;
1543-
GraphicsConfiguration graphicsConfiguration = graphics.getDeviceConfiguration();
1544-
if (graphicsConfiguration != null)
1545-
{
1546-
GraphicsDevice graphicsDevice = graphicsConfiguration.getDevice();
1547-
if (graphicsDevice != null)
1548-
{
1549-
deviceType = graphicsDevice.getType();
1550-
}
1551-
}
1552-
if (deviceType == GraphicsDevice.TYPE_PRINTER && !annotation.isPrinted())
1542+
if (destination == RenderDestination.PRINT && !annotation.isPrinted())
15531543
{
15541544
return;
15551545
}
1556-
if (deviceType == GraphicsDevice.TYPE_RASTER_SCREEN && annotation.isNoView())
1546+
if ((destination == RenderDestination.VIEW || destination == RenderDestination.EXPORT) &&
1547+
annotation.isNoView())
15571548
{
15581549
return;
15591550
}

0 commit comments

Comments
 (0)