[Poppler-bugs] [Bug 17901] Background not saved into copy after entering form data

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 4 10:28:46 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=17901





--- Comment #1 from Albert Astals Cid <tsdgeos at terra.es>  2008-10-04 10:28:45 PST ---
The PDF is encrypted ( /Encrypt 954 0 R ) and we don't take that into account
it, so that's why the rest of the document "disappears", with

iff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 19bb933..6c79fb6 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -836,7 +836,7 @@ void PDFDoc::writeTrailer (Guint uxrefOffset, int
uxrefSize, OutStream* outStr,
   obj1.initString(new GooString((const char*)digest, 16));

   //create ID array
-  Object obj2,obj3,obj4;
+  Object obj2,obj3,obj4,obj5;
   obj2.initArray(xref);

   if (incrUpdate) {
@@ -868,6 +868,12 @@ void PDFDoc::writeTrailer (Guint uxrefOffset, int
uxrefSize, OutStream* outStr,
   if (incrUpdate) {
     obj1.initInt(xref->getLastXRefPos());
     trailerDict->set("Prev", &obj1);
+
+    xref->getTrailerDict()->dictLookupNF("Encrypt", &obj5);
+    if (!obj5.isNull())
+    {
+      trailerDict->set("Encrypt", &obj5);
+    }
   }
   outStr->printf( "trailer\r\n");
   writeDictionnary(trailerDict, outStr);

the effect is exactly the opposite, the PDF is not destroyed, but our added
things don't get rendered because they are not encrypted.

We might want to just "return false" if the PDF is encrypted, at least don't
destroy the docuemnt, what do you say?


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list