]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/pdfinfo.cc
embryonic PDF viewer as a Bonobo container...
[evince.git] / pdf / xpdf / pdfinfo.cc
index fae8a182a79b4c22a02a21e86802afda823d4c95..78664aa2ba482b896c7b3e9576081006587a57f3 100644 (file)
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
 
   // open PDF file
   xref = NULL;
-  doc = new PDFDoc(fileName);
+  doc = new PDFDoc(bxpdfopen(fileName), fileName);
   if (!doc->isOk())
     exit(1);
 
@@ -106,16 +106,23 @@ int main(int argc, char *argv[]) {
   // print page count
   printf("Pages:        %d\n", doc->getNumPages());
 
-  // print encrypted flag
-  printf("Encrypted:    %s\n", doc->isEncrypted() ? "yes" : "no");
+  // print encryption info
+  printf("Encrypted:    ");
+  if (doc->isEncrypted()) {
+    printf("yes (print:%s copy:%s)\n",
+          doc->okToPrint() ? "yes" : "no",
+          doc->okToCopy() ? "yes" : "no");
+  } else {
+    printf("no\n");
+  }
 
   // clean up
   delete doc;
   freeParams();
 
   // check for memory leaks
-  Object::memCheck(errFile);
-  gMemReport(errFile);
+  Object::memCheck(stderr);
+  gMemReport(stderr);
 
   return 0;
 }