Get rid of unwanted JavaScript and attachments in a PDF file
- Install PyPDF
$ pip install -r requirements.txt
- Run
$ python main.py inputfile.pdf outputfile.pdf
It rebuilds the PDF from scratch, discarding any JavaScript embedded in actions and in the document root. Attachments are restored only if the user requests that when prompted.