mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 08:49:11 +08:00
Fix Issue 516. Page Dictionary Count field has incorrect page count. Compare with PageTree children count.
This commit is contained in:
parent
afe473e10e
commit
a7f64ec64b
@ -21,6 +21,12 @@
|
||||
this.pdfScanner = pdfScanner ?? throw new ArgumentNullException(nameof(pdfScanner));
|
||||
|
||||
Count = catalog.PagesDictionary.GetIntOrDefault(NameToken.Count);
|
||||
var CountOfPagesByPagesTree = catalog.PageTree.Children.Count;
|
||||
if (Count != CountOfPagesByPagesTree)
|
||||
{
|
||||
//log.Warning($"Dicrionary Page Count {Count} different to discovered pages {CountOfPagesByPagesTree}. Using {CountOfPagesByPagesTree}.");
|
||||
Count = CountOfPagesByPagesTree;
|
||||
}
|
||||
}
|
||||
|
||||
public Page GetPage(int pageNumber, InternalParsingOptions parsingOptions)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user