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).
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)"
Copy link to clipboard
Copied
I came on here to get answers, as I have been running into the same problem (11th Circuit Court of Appeals ECF).
The solution that worked for me was to get out of Adobe products entirely (as usual) and use Apple Preview. File>Export... and then when the dialog window opens, check the box for "Create Linearized PDF". Solved the problem in 30 seconds.
FYI. I find Apple Preview to be a superior tool to Acrobat in almost all situations, except perhaps automated page numbering.
Copy link to clipboard
Copied
NOTE:
It is important to understand the context of the technique that you are using with Apple Preview; it is known as "flattening" a PDF. And because you were able to flatten a document with Apple's Preview, that doesn't mean anything in regards of PDF software superiority or inferiority.
Flattening has been around since the mid-90's, it basically is a process that merges many PDF layers into a single layer, and it was released by Adobe Systems on or around 1993.
Nowadays, flattening can also be achieved with any web browser that supports native PDF reading, viewing and printing capabilities, or simply by using any virtual printing device drivers, such as "Microsoft Print to PDF" (if using a Windows box), and also on "CUPS-PDF (Virtual PDF Printer)" if on a Linux box (which can also be used on macOS boxes).
But using the "Export To" method in Adobe Acrobat is slightly more complicated when combined with tools such as Preflight that are mostly intended for analyzing and fixing PDF errors.
While analyzing PDFs with the aid of Acrobat's Preflight tool may fix print production issues, Adobe Acrobat also employs "Distiller", which isn't a virtual printer driver on its own; instead, it's a separate tool that converts PostScript files into PDF files. It operates alongside the "Adobe PDF" virtual printer that is shipped with Adobe Acrobat.
When you "Print To" or "Export To" Adobe PDF virtual printer from any software, the driver initially generates a PostScript file, which is subsequently forwarded to Distiller for conversion to a PDF file.
However, as you've pointed out, flattening with your Apple's Preview software appears to be the most straightforward solution in your situation, as it helps prevent discrepancies or errors that may arise if the PDF document contains corrupt accessible tags that are difficult to fix manually, or even harmful JavaScript code, or any other interactive components like layers. All of these can interfere with various elements and lead to printing issues.
And while flattening is not a breach of HIPAA regulations or within your legal domain, for instance, flattening a PDF into a single image layer can also be viewed as a more secure practice. This ensures that your document retains its intended look and layout when shared or printed, making it more challenging to alter PDF elements.
Nevertheless, in settings where electronic compliance must be adhered to rigorously (such as in the Pharmaceutical industry, FDA, or manufacturing), flattening a PDF is strictly prohibited as it disrupts the structural integrity of a PDF that is necessary for further distribution through electronic invoicing.
Consequently, this is regarded as a violation of specific ISO standards (particularly concerning European electronic invoicing standards), as it undermines electronic signatures or certificate-based digital signatures.
Copy link to clipboard
Copied
Please disregard my last post to your reply as I gave the incorrect guidance to your particular case. Thank you for updating this old thread with your solution!
I re-read your message and realized that I missed the part where you've specified that the PDF was Linearized (this is entirely different from flattening a PDF);.
The equivalent in Adobe Acrobat Pro should work in the same way if user goes to File => Save As and enable the "Save as optimizes for Fast Web View" option.
From further reading, I learned with your solution that a user can linearize a portion of a PDF document or the whole document, making the PDF web-friendly and facilitating the end users with PDF content that loads incrementally for faster online experience.
In doing so, the PDF document structure is rearranged, which may explain why some elements that were interfering with the original structure of that PDF are gone after the linearization process.
Copy link to clipboard
Copied
Apple Preview, aka "the PDF Killer", also kill the executable code in PDFs.
It may suit you in this case, but that doesn't make it better software, because it also destroys many other things in the process.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now