[poppler] Branch 'poppler-0.10' - poppler/PDFDoc.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Dec 28 15:32:13 PST 2008


 poppler/PDFDoc.cc |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit c9775563aa9da5a7b1c02e015f52641592ffa50d
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Dec 29 00:31:18 2008 +0100

    More improvements in document writing
    
    Dictionary keys are names so need to be sanitized
    Add a space after num gen obj

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index c2d03fe..056d0f4 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -635,7 +635,10 @@ void PDFDoc::writeDictionnary (Dict* dict, OutStream* outStr)
   Object obj1;
   outStr->printf("<<");
   for (int i=0; i<dict->getLength(); i++) {
-    outStr->printf("/%s ", dict->getKey(i));
+    GooString keyName(dict->getKey(i));
+    GooString *keyNameToPrint = keyName.sanitizedName(gFalse /* non ps mode */);
+    outStr->printf("/%s ", keyNameToPrint->getCString());
+    delete keyNameToPrint;
     writeObject(dict->getValNF(i, &obj1), NULL, outStr);
     obj1.free();
   }
@@ -711,7 +714,7 @@ Guint PDFDoc::writeObject (Object* obj, Ref* ref, OutStream* outStr)
   int tmp;
 
   if(ref) 
-    outStr->printf("%i %i obj", ref->num, ref->gen);
+    outStr->printf("%i %i obj ", ref->num, ref->gen);
 
   switch (obj->getType()) {
     case objBool:


More information about the poppler mailing list