How to remove JavaScript from PDFs

144 views
Skip to first unread message

Shakthi Wijeratne

unread,
Mar 11, 2021, 3:47:35 PM3/11/21
to PDFTron SDK
Q: I have a document in which I would like to remove any JavaScript actions as a way to sanitize it. How can I do it with the SDK?

A: With the SDK, its possible to traverse through the document at the SDF object level and remove any references any JavaScript actions as defined in section 12.6.4.17 of the PDF specification.

Please see the attached C# code that does so.
sanitize.cs
Reply all
Reply to author
Forward
0 new messages