Some details depend on how you are trying to use this script. I will assume it's used in one of the properties of the Acrobat element in a Switch flow.
First, get rid of the "<script type="text/javascript">" and "<script>" tags. Those are html tags, but Switch and Acrobat use JavaScript directly - no html.
As you noted, "this" is incorrect. You want it to be the document, provided by Switch. Replace every instance of "this." with "$doc."
The script will show an alert window if something goes wrong. In an automated environment this is usually not what you want, since the application will block until the user clicks the alert. Instead, you want to signal the error back to Switch. Change "app.alert(e);" to "$error = e.description"
More information can be found in the Switch help under "JavaScript for applications".
Acrobat script // Need help
Re: Acrobat script // Need help
Unfortunately you cannot test Adobe scripts in SwitchScripter. You'll have to create a simple flow in Switch and test it there.
Re: Acrobat script // Need help
All Systems Integration provided us a script to do exactly this. We had to break apart the PDF, dupe the pages, then merge the PDF back together. If that sounds like it would work for you, maybe just send them an email asking for it?
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
- andrea mahoney
- Newbie
- Posts: 19
- Joined: Tue Jan 25, 2011 8:53 pm
Re: Acrobat script // Need help
Hi,
Your script should be installed in the Command Section of the Acrobat Configurator, not the Save Section. Use the save section to save the pdf and close Acrobat.
Your script should be installed in the Command Section of the Acrobat Configurator, not the Save Section. Use the save section to save the pdf and close Acrobat.