mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-20 11:37:57 +08:00
fix #176, allow startxref to appear earlier in the document
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user