2014-04-30

Strip PDF restrictions on Mac OS X without any special tools

Assuming you have a PDF which has certain restrictions on it (for example you cannot edit the PDF using Preview in the usual way), but which you can print, this is how you can strip these restrictions from the PDF:

  • open the Printer Queue for your Printer
  • stop the Queue
  • print the PDF
    • now you should have a file starting with 'd' under /var/spool/cups which is an unprotected version of your PDF
  • in Terminal type sudo cp /var/spool/cups/d* ~/Desktop/d.pdf
    • this assumes there is just one file starting with a 'd' which is usually the case. If there are multiple files pick one by one until you have your file.
  • in Terminal type sudo chown foo:foo ~/Desktop/d.pdf (replace foo with your actual user name)
  • file ~/Desktop/d.pdf does not have any restrictions
  • in the Printer Queue delete the print job
  • start the Printer Queue
Note that this procedure does not allow you to strip passwords from files which you cannot print without a password. The restricted file must at least allow you to print the file.

Keine Kommentare: