This patch removes the support for copy and paste protection from pdf documents and is intended for use with xpdf version 0.93. The original patch did not work on version 0.93 (pdftotext.cc failed), but this one should.


To apply:

cd xpdf-0.93/
patch -p1 < xpdf-0.93-ro-remove.patch

diff -ruN xpdf-0.93/xpdf/pdftotext.cc xpdf-ro-removed-0.93/xpdf/pdftotext.cc
--- xpdf-0.93/xpdf/pdftotext.cc	Fri Oct 26 19:52:42 2001
+++ xpdf-ro-removed-0.93/xpdf/pdftotext.cc	Thu Dec 13 23:22:09 2001
@@ -136,10 +136,10 @@
   }
 
   // check for copy permission
-  if (!doc->okToCopy()) {
-    error(-1, "Copying of text from this document is not allowed.");
-    goto err1;
-  }
+  //  if (!doc->okToCopy()) {
+  //    error(-1, "Copying of text from this document is not allowed.");
+  //    goto err1;
+  //  }
 
   // construct text file name
   if (argc == 3) {
diff -ruN xpdf-0.93/xpdf/xpdf.cc xpdf-ro-removed-0.93/xpdf/xpdf.cc
--- xpdf-0.93/xpdf/xpdf.cc	Fri Oct 26 19:52:42 2001
+++ xpdf-ro-removed-0.93/xpdf/xpdf.cc	Thu Dec 13 23:12:28 2001
@@ -1320,7 +1320,9 @@
 	s = out->getText(selectXMin, selectYMin, selectXMax, selectYMax);
 	win->setSelection(NULL, s);
       } else {
-	error(-1, "Copying of text from this document is not allowed.");
+	error(-1, "Copying of text from this document is not allowed, but possible :-).");
+	s = out->getText(selectXMin, selectYMin, selectXMax, selectYMax);
+	win->setSelection(NULL, s);
       }
 #endif
 
