summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorThomas Freitag <Thomas.Freitag@alfa.de>2013-12-20 20:25:26 +0100
committerAlbert Astals Cid <aacid@kde.org>2013-12-20 20:25:26 +0100
commit5234a349adb678d267a3d8ca13176ac8abb7afd2 (patch)
treeaaf3a040a3d5684046bb73c374d431c3da590e6b /utils
parent8e24fcc0d296e07327e9cbe297f627bfc6471ee3 (diff)
pdfunite: do not lose fonts when merging some files
Diffstat (limited to 'utils')
-rw-r--r--utils/pdfunite.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index 6573f044..5f67c0ef 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -119,9 +119,15 @@ int main (int argc, char *argv[])
Ref *refPage = docs[i]->getCatalog()->getPageRef(j);
Object page;
docs[i]->getXRef()->fetch(refPage->num, refPage->gen, &page);
+ Dict *pageDict = page.getDict();
+ Dict *resDict = docs[i]->getCatalog()->getPage(j)->getResourceDict();
+ if (resDict) {
+ Object *newResource = new Object();
+ newResource->initDict(resDict);
+ pageDict->set("Resources", newResource);
+ }
pages.push_back(page);
offsets.push_back(numOffset);
- Dict *pageDict = page.getDict();
docs[i]->markPageObjects(pageDict, yRef, countRef, numOffset);
}
objectsCount += docs[i]->writePageObjects(outStr, yRef, numOffset, gTrue);