Merge pull request #438 from adrg/fix-reader-page-count

Account for page count being a reference in the reader
This commit is contained in:
Gunnsteinn Hall 2019-04-22 17:34:32 +00:00 committed by GitHub
commit 15bd7e8b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,7 +214,7 @@ func (r *PdfReader) loadStructure() error {
common.Log.Debug("ERROR: Pages object invalid (%s)", ppages)
return errors.New("pages object invalid")
}
pageCount, ok := pages.Get("Count").(*core.PdfObjectInteger)
pageCount, ok := core.GetInt(pages.Get("Count"))
if !ok {
common.Log.Debug("ERROR: Pages count object invalid")
return errors.New("pages count invalid")