These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Can you sanitize a document via javascript??

khillebrand
Registered: Apr 24 2006
Posts: 26

Sanitize is exactly the feature we've been waiting for for court filings and would eliminate the 'print to pdf' options we've been using. But can you sanitize via javascript? Can I put a button on a form that my users can press to sanitize when they have completed filling in the fields? I was not able to find any documentation.
 
Also, IMHO, if buttons are visible but do not print, I would think sanitize should remove them since they are for functionality but are not part of the actual form. Obviously I could code to hide the buttons and then sanitize (provided I can do this via javascript), but it's just another step. My preference would be to do this programmatically.
 
Thank you!

My Product Information:
Acrobat Pro 10.0.1, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
There's no JS function linked to the Sanitize action, and although you could perform some of the steps with individual procedures (such as flattening form fields) most of the changes it makes are not possible to script.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ahh, but there is something you can do to sanitize a PDF using JS. Starting in Acrobat 9, there is a JS function for running a preflight profile. So, if you can find a profile, or create one that fits your needs, then you can run it with a script.


Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script