Sanitizing PDF files with ghostscript

From Sterbal's Sundry Studies

use Ghostscript (v9.22) to sanitize the pdf file:

  • C:\path\to\ghostscript -dNOPAUSE -sDEVICE=ps2write -sOUTPUTFILE=temp.ps file.pdf
  • C:\path\to\ghostscript -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=sanitized_file.pdf temp.ps
  • del temp.ps

What Links Here[edit]