]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 22 Aug 2003 20:47:17 +0000 (20:47 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 22 Aug 2003 20:47:17 +0000 (20:47 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3877 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
pdftops/Error.cxx
pdftops/Gfx.cxx

index 7be281c3e7271ec932ec22b548a5fa2794584ba1..56bc4addf027d95b904ebec3f9cd157f6ecabbba 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - The PDF filter no longer prints form widgets; this
+         duplicates the behavior of Acrobat Reader (STR #241)
        - cupsGetPPD() didn't handle a late termination of a
          HTTP connection with the server (STR #220)
        - ppdOpen() did not correctly check for "*PPD-Adobe-4."
index 6315c721f0489e762aeffa9691f3cf352f49a5f5..d2804c671394a702e32198366fc43f637f56e070 100644 (file)
@@ -26,9 +26,9 @@ void CDECL error(int pos, const char *msg, ...) {
     return;
   }
   if (pos >= 0) {
-    fprintf(stderr, "Error (%d): ", pos);
+    fprintf(stderr, "ERROR: (%d) ", pos);
   } else {
-    fprintf(stderr, "Error: ");
+    fprintf(stderr, "ERROR: ");
   }
   va_start(args, msg);
   vfprintf(stderr, msg, args);
index 0ea019bea34696a271be547112216af576a0150a..1e1ab75d4d2be0dd7bc04beb11183c793458ea83 100644 (file)
@@ -2472,7 +2472,7 @@ void Gfx::doForm(Object *str) {
 void Gfx::doAnnot(Object *str, double xMin, double yMin,
                  double xMax, double yMax) {
   Dict *dict, *resDict;
-  Object matrixObj, bboxObj, resObj;
+  Object matrixObj, bboxObj, resObj, subTypeObj;
   Object obj1;
   double m[6], bbox[6], ictm[6];
   double *ctm;
@@ -2484,6 +2484,29 @@ void Gfx::doAnnot(Object *str, double xMin, double yMin,
   // get stream dict
   dict = str->streamGetDict();
 
+  // check if the SubType is set to Widget, and ignore if so - we don't
+  // need no stinkin' buttons in the PS output!
+  dict->lookup("SubType", &subTypeObj);
+
+  if (!subTypeObj.isName()) {
+    if (subTypeObj.isNull()) {
+      error(getPos(), "Missing (required) SubType in Annot object");
+    } else {
+      error(getPos(), "Bad Annot object SubType of type %s", subTypeObj.getTypeName());
+    }
+
+    subTypeObj.free();
+    return;
+  }
+
+  if (subTypeObj.isName("Widget")) {
+    // Don't draw form widgets...
+    subTypeObj.free();
+    return;
+  }
+
+  subTypeObj.free();
+
   // get the form bounding box
   dict->lookup("BBox", &bboxObj);
   if (!bboxObj.isArray()) {