pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1768105 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Fri, 04 Nov 2016 21:25:10 GMT
Author: tilman
Date: Fri Nov  4 21:25:10 2016
New Revision: 1768105

URL: http://svn.apache.org/viewvc?rev=1768105&view=rev
Log:
PDFBOX-3556: don't throw exception for wrong version

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1768105&r1=1768104&r2=1768105&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java Fri Nov 
4 21:25:10 2016
@@ -1947,7 +1947,14 @@ public class COSParser extends BaseParse
         }
         if (headerVersion < 0)
         {
-            throw new IOException( "Error getting header version: " + header);
+            if (isLenient)
+            {
+                headerVersion = 1.7f;
+            }
+            else
+            {
+                throw new IOException("Error getting header version: " + header);
+            }
         }
         document.setVersion(headerVersion);
         // rewind



Mime
View raw message