[poppler] utils/pdfunite.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Dec 20 11:26:11 PST 2013


 utils/pdfunite.cc |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 5234a349adb678d267a3d8ca13176ac8abb7afd2
Author: Thomas Freitag <Thomas.Freitag at alfa.de>
Date:   Fri Dec 20 20:25:26 2013 +0100

    pdfunite: do not lose fonts when merging some files

diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index 6573f04..5f67c0e 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);


More information about the poppler mailing list