Set Pages dict Type if not set (#419)

This commit is contained in:
Adrian-George Bostan 2019-04-18 00:17:22 +03:00 committed by Gunnsteinn Hall
parent ca4f19e5e8
commit d34ba3c29e

View File

@ -219,6 +219,10 @@ func (r *PdfReader) loadStructure() error {
common.Log.Debug("ERROR: Pages count object invalid")
return errors.New("pages count invalid")
}
if _, ok = core.GetName(pages.Get("Type")); !ok {
common.Log.Debug("Pages dict Type field not set. Setting Type to Pages.")
pages.Set("Type", core.MakeName("Pages"))
}
r.root = root
r.catalog = catalog