Skip to content

Instantly share code, notes, and snippets.

@jzhou77
Last active July 22, 2025 10:24
Show Gist options
  • Select an option

  • Save jzhou77/a2300a4d02e43c1938012b72dcdfbb46 to your computer and use it in GitHub Desktop.

Select an option

Save jzhou77/a2300a4d02e43c1938012b72dcdfbb46 to your computer and use it in GitHub Desktop.
Use open source QPDF:
$ qpdf --decrypt input.pdf output.pdf
And the restrictions were removed. Note that the original PDF was not password protected.
Another way of using ghostscript:
$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -f INPUT.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment