These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Printing/Saving subsets of pages from a PDF

ghostwhoworks
Registered: Jul 9 2007
Posts: 2

Need to ask the user to agree to the terms and conditions of a document upon printing or saving.
 
Once they agree we only want them to be print a subset of the pages in the document (not all).
 
At present I can only seem to make this happen so that the print range is set in the print dialog.
 
This is no good as we don't want them to be able to change the print range.
 
So I suppose I'm asking, is there any way to stop certain pages of a document being printed and/or saved when printing or saving the entire document - when the client is viewing the document in the reader?
 
There must be a way to do this in the DOM... I just can't find it.
 
Thanks you wonderful experts!

My Product Information:
Acrobat Pro 7.0.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Once the user has a PDF, they can do with it what they want. Using ordinary PDF features and JavaScript you cannot stop them from printing or saving the file. Actually, if they are viewing the file it is already saved on thier system. There are security features you can apply, but these are weak. Maybe there is a DRM solution for this but I don't know what it is.

You can however make things difficult for everyone but the experts. For example, place full page opague watermarks over all the pages you don't want printed. User JavaScript from the [url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/]Console Window[/url] to rename the OCG Layers created by adding the watermark and turn them off.

Then use the "WillSave" and "WillPrint" events to turn the OCGs on right before printing or saving. In the case of saving you'll also have to change the default state of the OCGs to On. You may also need to play tricks with hidden fields to make sure the state sticks. Here's an article on OCGs

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/create_use_layers/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/create_use_layers/[/url]

Turning off JavaScript and/or knowlege that's in the article above can defeat this mechanism. But only a few people will be able to do that.

Also, this method only applies to AcroForms

You can sort of force people to open the doc with JS. check out the "doc.addRequirment()" function in the Acrobat JavaScript Reference.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script