Index: src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
===================================================================
--- src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java	(revision 773978)
+++ src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java	(working copy)
@@ -467,7 +467,7 @@
                 //System.out.println( "parseObject() num=" + number +
                 //" genNumber=" + genNum + " key='" + objectKey + "'" );
                 if( !objectKey.equals( "obj" ) )
-                {
+                {                    
                     throw new IOException("expected='obj' actual='" + objectKey + "' " + pdfSource);
                 }
             }
@@ -581,7 +581,7 @@
             return false; 
         }
         String nextLine = readLine();
-        if( !nextLine.equals( "startxref" ) ) {
+        if( !nextLine.trim().equals( "startxref" ) ) {
             return false;
         }
         skipSpaces();
@@ -605,7 +605,7 @@
             return false;
         }
         String nextLine = readLine();
-        if( !nextLine.equals( "xref" ) ) {
+        if( !nextLine.trim().equals( "xref" ) ) {
             return false;
         }
         /*
@@ -665,7 +665,7 @@
         }
         //read "trailer"
         String nextLine = readLine();
-        if( !nextLine.equals( "trailer" ) ) {
+        if( !nextLine.trim().equals( "trailer" ) ) {
             // in some cases the EOL is missing and the trailer immediately continues with "<<" or with a blank character
             // even if this does not comply with PDF reference we want to support as many PDFs as possible
             // Acrobat reader can also deal with this.
