diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index 46c4544..536694e 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -701,6 +701,12 @@ int PDFDoc::savePageAs(GooString *name, int pageNo) markPageObjects(catDict, yRef, countRef, 0, refPage->num, rootNum + 2); Dict *pageDict = page.getDict(); + if (resourcesObj.isNull() && !pageDict->hasKey("Resources")) { + if (getCatalog()->getPage(pageNo)->getResourceDict() != NULL) { + resourcesObj.initDict(getCatalog()->getPage(pageNo)->getResourceDict()); + markPageObjects(resourcesObj.getDict(), yRef, countRef, 0, refPage->num, rootNum + 2); + } + } markPageObjects(pageDict, yRef, countRef, 0, refPage->num, rootNum + 2); pageDict->lookupNF("Annots", &annotsObj); if (!annotsObj.isNull()) {