BASALT · JOURNAL
How to inspect JavaScript inside a PDF on Mac
PDF JavaScript can power forms and calculations, but a document can also contain actions that surprise a recipient. Inspect unfamiliar PDFs before sharing them, especially when they came from an external party or were assembled from many files.
Check actions and interactive objects
Review document-open actions, page actions, links, buttons, form calculations, embedded files, and launch actions. An ordinary-looking page can contain behavior outside the visible text. Disable automatic execution in your viewer while investigating an untrusted document.
Decide what to remove
If the recipient only needs a static record, remove scripts, actions, comments, form fields, and attachments that are not necessary. Preserve interactivity only when the workflow depends on it and the source is trusted. A flattened copy can be safer, but confirm that accessibility and required fields remain usable.
Verify the exported copy
Open the output in a second viewer, inspect properties and attachments, and test that no unexpected prompt or action occurs. Search the document for sensitive values and confirm the page images still match the approved source.
Frequently asked questions
Is PDF JavaScript the same as a web browser script?
No, but it can still trigger document actions and interact with forms or the viewer. Treat unfamiliar scripts cautiously.
Can I remove JavaScript without deleting the page content?
Often, yes. Remove scripts and actions while preserving the static page content, then test the output.
Should every PDF be flattened?
No. Flattening can remove useful accessibility or form behavior. Use it when a static release copy is the right outcome.
Doing it in Basalt
Basalt helps inspect and remove hidden PDF actions on-device, alongside metadata, annotations, and attachments, before verification and export. Download Basalt.
Redaction that proves itself
Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.