You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ad...@apache.org on 2010/08/27 18:32:13 UTC

svn commit: r990201 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java

Author: adam
Date: Fri Aug 27 16:32:13 2010
New Revision: 990201

URL: http://svn.apache.org/viewvc?rev=990201&view=rev
Log:
PDFBOX-506: PDFBox can't parse PDF documents from jstor.org

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java?rev=990201&r1=990200&r2=990201&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Fri Aug 27 16:32:13 2010
@@ -471,10 +471,9 @@ public class PDFParser extends BaseParse
                 if("%%EOF".equals(eof)) {
                     // PDF does not conform to spec, we should warn someone
                     log.warn("expected='%%EOF' actual='" + eof + "'");
-                    // if we're not at the end of a file, this is a really big deal!
+                    // if we're not at the end of a file, just put it back and move on
                     if(!pdfSource.isEOF())
-                        throw new IOException( "expected='%%EOF' actual='" + eof +
-                                "' next=" + readString() + " next=" +readString() );
+                        pdfSource.unread(eof.getBytes());
                 }
                 isEndOfFile = true; 
             }