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 2020/05/02 04:15:45 UTC
svn commit: r1877277 -
/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Author: tilman
Date: Sat May 2 04:15:44 2020
New Revision: 1877277
URL: http://svn.apache.org/viewvc?rev=1877277&view=rev
Log:
PDFBOX-4821: replace zero component empty clipping path with empty rectangle so that it isn't ignored when printing
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1877277&r1=1877276&r2=1877277&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Sat May 2 04:15:44 2020
@@ -379,7 +379,16 @@ public class PageDrawer extends PDFGraph
Area clippingPath = getGraphicsState().getCurrentClippingPath();
if (clippingPath != lastClip)
{
- graphics.setClip(clippingPath);
+ if (clippingPath.getPathIterator(null).isDone())
+ {
+ // PDFBOX-4822: avoid bug with java printing that empty clipping path is ignored by
+ // replacing with empty rectangle, works because this is not an empty path
+ graphics.setClip(new Rectangle());
+ }
+ else
+ {
+ graphics.setClip(clippingPath);
+ }
if (initialClip != null)
{
// apply the remembered initial clip, but transform it first