fix #176, allow startxref to appear earlier in the document

This commit is contained in:
Eliot Jones
2020-05-31 17:01:38 +01:00
parent 4312aa470e
commit bf45602ac5
2 changed files with 51 additions and 29 deletions

View File

@@ -90,5 +90,21 @@
Assert.False(document.TryGetBookmarks(out _));
}
}
[Fact]
public void StartXRefNotNearEnd()
{
var bytes = File.ReadAllBytes(GetFilename());
var emptyTrailer = new byte[2026];
emptyTrailer[0] = 10;
bytes = bytes.Concat(emptyTrailer).ToArray();
using (var document = PdfDocument.Open(bytes, ParsingOptions.LenientParsingOff))
{
Assert.Equal(1, document.NumberOfPages);
}
}
}
}