Yes, but there's one down-side to printing with JS: You can only print a
single range of pages, so if you want to print page 1, 3, 5, 6 and 8 you
need to send 4 different print commands, and the user has to approve each
one separately (unless you use a more complex script that is installed on
the local machine).
Ok, can I set a page as printable or not based on whether a checkbox is checked? I have a document of 20 pages. I always want the first 6 pages to print. I want the user to be able to use checkboxes on the first page to determine which of the other 14 pages print. Is this possible?
No, you can't set a page to printable or not... What I described was a way to call the Print dialog and specify the page range to be printed. But the user can still change that, or use the internal Print command and then that script won't work.
Alternatively, if the file is used in Acrobat you can hide the pages by using a template, or in Reader you can use form fields to hide their contents.
Actually, I've been doing some research recently and I believe I have found a way to make pages completely unprintable, even in Reader. If you're interested in this solution, contact me privately, by PM or email (try6767[at]gmail.com).