mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 04:48:53 +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
@ -51,7 +51,7 @@
|
||||
8,
|
||||
("Extract Words with newline detection (example with algorithm). Issue 512",
|
||||
() => OpenDocumentAndExtractWords.Run(Path.Combine(filesDirectory, "OPEN.RABBIT.ENGLISH.LOP.pdf")))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var choices = string.Join(Environment.NewLine, examples.Select(x => $"{x.Key}: {x.Value.name}"));
|
||||
|
@ -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