What is your best recommendation for a tool to see/remove JS content from a PDF file in Linux?

Hello Neville

I wonder if you converted it to a postscript file (.ps) would that remove it?
I think there is a program pdf2ps .

I don’t have idea if it is possible … @Rosika some thougths about this? Perhaps it is related with the pdfinfo command suggested by you at:

Continuing

" convert it from pdf to ps and back to pdf. Basically, it prints the file, which (I believe) will remove all meta information. I imagine that pdf2ps doesn’t have a built in javascript library, so I think it is safe to assume that any malicious javascript will be securely removed in this process ."

From where you took that statement? It has " "

Yes that seems OK

If some member of this network can confirm that would be great

Another idea. You can use the qpdf program to inspect a pdf and remove things manually.

Have you test it?

Note :
There is a program called diffpdf which compares 2 pdf files… like diff compares 2 txt files. You could use it to check if things have been removed.

Huge thanks for that command … but for this scenario only exists 1 file, therefore there is no other file to do a comparison but this command now is in my toolbox

As usual huge thanks for your polite support friend!

3 Likes