I need to allow my JavaScipt to run in a privileged context in order to allow this.mailForm(..) to run without user interaction. The above reference on p. 144 tells me how to "mark a function as trusted." It gives me a script for a "trustedNewDoc" function to put in a .js file which it says "can be executed from anywhere" but "cannot normally be executed from a mouse up event."
Please tell me how to attach this .js file to my PDF document.
(I know in HTML, I can attach a .js file with the line:
but I don't know how to do it with a PDF document on my website.)