Generic Xpdf Patch Instructions

by "Anonymous"

These instructions have been tested in xpdf versions 0.92 and 0.93, and will probably work in all future versions. I am not providing a patch as that pach will have to be updated for new versions, these instructions most likely will work on all future versions.

This patch will disable all protections in the entire xpdf suite, not just in one or two converters. There is one catch, in that the program "pdfinfo" will not display the correct restrictions, but list all functions as enabled (i.e. no restrictions). This means that you can't use pdfinfo to find out the actual restrictions on a pdf file.

First, open XRef.cc in your favorite text editor. Then find the function "okToCopy()". You will see a line that says "return gFalse", replace gFalse with gTrue. Repeat the same thing with okToPrint(), okToAddNotes(), and okToChange(). All four functions are right next to each other in XRef.cc. Here is an example for okToCopy:

The original function:
GBool XRef::okToCopy() {
#ifndef NO_DECRYPTION
  if (!(permFlags & permCopy)) {
    return gFalse;
  }
#endif
  return gTrue;
}

The modified function:
GBool XRef::okToCopy() {
#ifndef NO_DECRYPTION
  if (!(permFlags & permCopy)) {
    return gTrue;
  }
#endif
  return gTrue;
}

Return to the Gallery of Adobe Remedies.


Dave Touretzky
Last modified: Wed Dec 26 23:34:35 EST 2001