Remove JavaScript from a PDF

PDFs can run JavaScript when they open, when you turn a page or click a field. Remove the scripts and the automatic actions and the document stays readable, just without code.

How it works

  1. Drop one or more PDF files.
  2. Scripts and automatic actions are removed from the whole document.
  3. Download the PDF without scripts.

Works well for

  • PDFs from unknown sources, before you open them in a viewer that runs scripts.
  • Documents that open pop-ups, print dialogs or websites by themselves.
  • Archiving: static documents without code are easier to keep and check.
  • Several files at once, for example a whole folder of downloads.

Limitations

  • Forms that calculate totals, validate input or change fields depending on your choices stop doing that.
  • All automatic actions are removed, including those without JavaScript, such as actions that run when a page opens.
  • This is not a virus scanner: it removes scripts and actions, but does not check the file for malware.
  • Password-protected (encrypted) PDFs are refused – remove the password first.

Frequently asked questions

Where can JavaScript hide in a PDF?

In document-level scripts, in the action that runs when the file is opened, in links and buttons, and in automatic actions attached to pages, annotations and form fields. The tool removes all of these.

Why remove JavaScript from a PDF?

Scripts are rarely needed to read a document, but they have been used to attack PDF viewers, track when a file is opened or open websites. A PDF without scripts is simpler and safer to pass on.

Will the document still work?

Text, images, links to websites and bookmarks stay. Only things done by code stop: calculations, validations, buttons with scripts and automatic actions.

Is the PDF uploaded?

No. The file is processed in your browser without running any of its scripts, and it stays on your device. Pro users can also use the paid HTTP API.