Remove executable code from PDF
Copy link to clipboard
Copied
Hi there, I have a series of pdf files that I need a way to figure out if there is executable code inside the files. Do you know of a good method to do this on a batch level?
Copy link to clipboard
Copied
You can use the Preflight tool or the PDF Optimiser (Save as Other).
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Hmm the pdf is still being rejected. Is there a way to extract the contents that show the code?
Copy link to clipboard
Copied
Exactly what reason is being give by whom for the file being rejected?
JavaScript isn't the only possibility here. Perhaps whatever is examining the PDF file is looking for any embedded attached files. You can get rid of those via the optimizer as follows:
Copy link to clipboard
Copied
Docments with executable code is not permitted.
Copy link to clipboard
Copied
Exactly who or what is claiming that you still have executable code in your PDF file? Apparently, executable code can mean any number of things to different persons or tools.
Copy link to clipboard
Copied
It's a court system. So the best way to i think is editing or removing the executable or what they define executable code using vbs but i won't go down that route unless i can't do it from the UI.
Copy link to clipboard
Copied
The entire thing is pointless unless you know what they mean by "executable code". It's obviously not what we mean, or the methods described above would have taken care of it already.
Copy link to clipboard
Copied
But wouldn't there be a static piece of content that i can parse out from a batch process? executable code must be limited to links, headers info. Something i just can't be my finger on it.
Copy link to clipboard
Copied
Assuming "executable code" means "JavaScript code" it can be located at the doc-, field-, page-, bookmark- and link-levels, and in multiple locations under each one. But the Preflight action mentioned above will remove all of those.
Copy link to clipboard
Copied
Thanks for the fix. The windows don't look exactly like this in Acrobat DC, but I was able to go into the Preflight and get rid of the java script, which did the trick for uploading to the Ninth Circuit Court of Appeals' ECF system.
Copy link to clipboard
Copied
I am having the same issue as the OP but in a different jurisdiction on the same court filing system (SDNY, NextGen ECF). I've tried all of the above suggestions but the court filing system rejecting it still says it "contains code which may cause an external action (such as launching an application)"

