I'm looking to place some code to print just the current page of whatever document is open, into Acro Reader 9.0.
Why want you do this?
Because I have thousands of documents, each hundreds of pages long, which users search and print from - almost always they require just the page they are on. Because 'All Pages' is the default and users fingers move faster than their brains, we end up with many miss prints, wasting all kinds of resources.
1 person found this helpful
Your assumptions are correct, but you're missing an important bit.
The code to print the current page can't be just located in a folder (or application) level script on its own. Those scripts get executed the moment the app opens, even before any file is opened, so trying to print a page at that point is futile.
What you need to do is place this code inside of a function, and then create a new menu or toolbar item that calls that function.
Look in the reference files under app.addMenuItem or app.addToolButton. This code can be placed in the same file as your printing command (anything.js), but outside of a function. It will then add the menu or toolbar item to the application when launched. There are examples for such code in the reference files.
Is there a way to modify the parameters of the default print dialog, rather than creating a whole new button? Or am I best to create the new button and remove the default one?
You can't modify the parameters of the default dialog.