pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1631814 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Tue, 14 Oct 2014 16:37:56 GMT
Author: tilman
Date: Tue Oct 14 16:37:55 2014
New Revision: 1631814

URL: http://svn.apache.org/r1631814
Log:
PDFBOX-1727: Adjust the cropbox to a smaller mediabox if needed, as pointed out by Jake Robb

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1631814&r1=1631813&r2=1631814&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Tue Oct
14 16:37:55 2014
@@ -171,14 +171,16 @@ public class PageDrawer extends PDFGraph
         // Only if there is some content, we have to process it.
         // Otherwise we are done here and we will produce an empty page
         PDPage page = getPage();
+        
+        PDRectangle adjustedCropBox = page.calcAdjustedCropBox();
+        
         if (page.getContents() != null)
         {
-            PDResources resources = page.findResources();
-            processStream(resources, page.getContents().getStream(), page.findCropBox());
+            processStream(page.findResources(), page.getContents().getStream(), adjustedCropBox);
         }
         else
         {
-            initStream(page.findCropBox());
+            initStream(adjustedCropBox);
         }
 
         for (PDAnnotation annotation : page.getAnnotations())



Mime
View raw message