diff --git a/src/PdfSharp/Pdf.IO/Parser.cs b/src/PdfSharp/Pdf.IO/Parser.cs index 07b353a9..d09322bf 100644 --- a/src/PdfSharp/Pdf.IO/Parser.cs +++ b/src/PdfSharp/Pdf.IO/Parser.cs @@ -189,8 +189,8 @@ public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool incl break; // Acrobat 6 Professional proudly presents: The Null object! - // Even with a one-digit object number an indirect reference «x 0 R» to this object is - // one character larger than the direct use of «null». Probable this is the reason why + // Even with a one-digit object number an indirect reference «x 0 R» to this object is + // one character larger than the direct use of «null». Probable this is the reason why // it is true that Acrobat Web Capture 6.0 creates this object, but obviously never // creates a reference to it! case Symbol.Null: @@ -1025,10 +1025,10 @@ internal PdfTrailer ReadTrailer() // If "startxref" was still not found yet, read the file completely. string trail = _lexer.ReadRawString(0, length); idx = trail.LastIndexOf("startxref", StringComparison.Ordinal); + if (idx == -1) + throw new Exception("The StartXRef table could not be found, the file cannot be opened."); _lexer.Position = idx; } - if (idx == -1) - throw new Exception("The StartXRef table could not be found, the file cannot be opened."); ReadSymbol(Symbol.StartXRef); _lexer.Position = ReadInteger(); @@ -1237,7 +1237,7 @@ private PdfTrailer ReadXRefStream(PdfCrossReferenceTable xrefTable) int prev = xrefStream.Elements.GetInteger(PdfCrossReferenceStream.Keys.Prev); PdfArray w = (PdfArray)xrefStream.Elements.GetValue(PdfCrossReferenceStream.Keys.W); - // E.g.: W[1 2 1] ¤ Index[7 12] ¤ Size 19 + // E.g.: W[1 2 1] ¤ Index[7 12] ¤ Size 19 // Setup subsections. int subsectionCount; @@ -1815,4 +1815,4 @@ public static uint ReadBytes(byte[] bytes, int index, int byteCount) return value; } } -} \ No newline at end of file +}