I am trying to add JavaScript to my PDF that will print the PDF and then close the window. I can get the printing part to work, but not the closing part. Any suggestions?
Dim javaScript as new DocumentJavaScript( "Test", "this.print({bUI: true, bSilent: true, bShrinkToFit: true});" & "\r\n" & "this.closeDoc();" )
Acrobat JavaScript
Re: Acrobat JavaScript
Support · Feb 5, 2007Hello,
It is not possible to close the document immediately after printing it. You may have to add some button to the PDF document, which when clicked will trigger the JavaScript.
<INPUT type="button" value="Close Window" onClick="window.close()">
Thanks,
ceTe Software Support Team