pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1640989 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Date Fri, 21 Nov 2014 20:02:48 GMT
Author: tilman
Date: Fri Nov 21 20:02:48 2014
New Revision: 1640989

URL: http://svn.apache.org/r1640989
Log:
PDFBOX-2423: use LETTER as default pagesize if no mediabox is defined (see also PDFBOX 1515
/ rev 1465217)

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1640989&r1=1640988&r2=1640989&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Fri Nov 21 20:02:48
2014
@@ -19,6 +19,8 @@ package org.apache.pdfbox.pdmodel;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.pdfbox.contentstream.PDContentStream;
 import org.apache.pdfbox.cos.COSArray;
@@ -45,6 +47,11 @@ import org.apache.pdfbox.util.Matrix;
  */
 public class PDPage implements COSObjectable, PDContentStream
 {
+    /**
+     * Log instance
+     */
+    private static final Log LOG = LogFactory.getLog(PDPage.class);
+    
     private final COSDictionary page;
     private PDResources pageResources;
     private PDRectangle mediaBox;
@@ -193,6 +200,11 @@ public class PDPage implements COSObject
                 mediaBox = new PDRectangle(array);
             }
         }
+        if (mediaBox == null)
+        {
+            LOG.debug("Can't find MediaBox, will use U.S. Letter");
+            mediaBox = PDRectangle.LETTER;
+        }
         return mediaBox;
     }
 



Mime
View raw message