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

Limiting printing to specific pages

Duniagdra
Registered: Sep 24 2008
Posts: 140
Answered

I'm trying to find how to limit printing to specific pages, omitting others that don't ever need to be printed. Can this be done?

Thanks in advance for any help provided,
Jim

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack

My Product Information:
Acrobat Pro 8.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
When using the "print" JavaScript statement, you can specify a range of continuous pages to print. To print a discontinuous range, you'd have to use more than one print statement.

George
Duniagdra
Registered: Sep 24 2008
Posts: 140
George_Johnson wrote:
When using the "print" JavaScript statement, you can specify a range of continuous pages to print. To print a discontinuous range, you'd have to use more than one print statement.George
Thanks George for your response. Your help as is the help of others is always welcome. I've been researching this a few weeks now and I'm not finding anything showing examples of the print javascript. That's why I came here to the acrobat forum thinking maybe there was a document setting to use for this. At first I though I could use Advanced >> Print Production >> Add Print Marker - Page Range and just put my non printing pages to the end, but that didn't work.Do you know where I could find an example of the print method to exclude pages 5, 9-12, and 20 for example?

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Beginning with Acrobat 8 you can specify a range of continuous pages to print in the [b]Document properties panel[/b]. But you can't define a discontinuous range.

Otherwise you may consider using layers with PrintState : OFF
(Print : never print in the layer properties)
Duniagdra
Registered: Sep 24 2008
Posts: 140
Merlin wrote:
Beginning with Acrobat 8 you can specify a range of continuous pages to print in the [b]Document properties panel[/b]. But you can't define a discontinuous range.Otherwise you may consider using layers with PrintState : OFF
(Print : never print in the layer properties)
Thanks, Merlin, for your input. I know absolutely nothing about layers though I have been curious in their usability and creation. Do you have any recommendations on literature for creating and using layers. I've found so far that there are ways to use layers to "hide" fields, but I'm not yet finding anything that tells me how to create layers or implement them in my existing document. When I click the layers tab and view options, it's all grayed out. I'm still researching this as I wait for a response. No rush.

Again, thanks for any help in this matter. It's truly appreciated.
Jim

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
To print a range of pages using JavaScript, you just need to specify the starting and ending pages. For example:

// Print pages 1-4print({nStart: 0, nEnd: 3}); // Print pages 6-8print({nStart: 5, nEnd: 7});

The Acrobat JavaScript reference has a lot more information on the doc.print method.

With layers you can control what page contents get printed, but not whether a page gets printed. Thom Parker wrote a nice article here (in the JavaScript Corner) about using layers (aka OCGs) with JavaScript.

George
Duniagdra
Registered: Sep 24 2008
Posts: 140
Thanks George. I've tried looking for this always referenced "Acrobat JavaScript reference", but I keep having trouble finding it unless I just don't realize I've seen it.

Now that you mention it, I do remember seeing an article by him there. I'll go check that out.

Thanks for the code. I've put it in a button and moved my calculation pages to the end. If the user clicks my print button, they'll only get what they need, but if they click the print button in acrobat, they'll get all pages. I'm not worried about that. This will work for my intent.

Thanks to both of you, George and Merlin, for your input.
Jim

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You must get it! You can get a PDF version of the Acrobat JavaScript reference here: http://www.adobe.com/devnet/acrobat/javascript.php

Also get the companion document title "Developing Acrobat Applications Using JavaScript". Both should help tremendously in your JavaScript programming endeavor.

The latest version (9) is only available along with the rest of the Acrobat SDK, which is distributed only as HTML, unfortunately.

George
prander
Registered: Nov 6 2008
Posts: 44
George_Johnson wrote:
To print a range of pages using JavaScript, you just need to specify the starting and ending pages. For example:
// Print pages 1-4print({nStart: 0, nEnd: 3}); // Print pages 6-8print({nStart: 5, nEnd: 7});

The Acrobat JavaScript reference has a lot more information on the doc.print method.

With layers you can control what page contents get printed, but not whether a page gets printed. Thom Parker wrote a nice article here (in the JavaScript Corner) about using layers (aka OCGs) with JavaScript.

George
Would this best be used as script for the page or could this be used in the script for a 'print' button?

Thanks
Duniagdra
Registered: Sep 24 2008
Posts: 140
prander wrote:
George_Johnson wrote:
To print a range of pages using JavaScript, you just need to specify the starting and ending pages. For example:
// Print pages 1-4print({nStart: 0, nEnd: 3}); // Print pages 6-8print({nStart: 5, nEnd: 7});

The Acrobat JavaScript reference has a lot more information on the doc.print method.

With layers you can control what page contents get printed, but not whether a page gets printed. Thom Parker wrote a nice article here (in the JavaScript Corner) about using layers (aka OCGs) with JavaScript.

George
Would this best be used as script for the page or could this be used in the script for a 'print' button?

Thanks
I have it as a "print" button" action on mouse down run a javascript.

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack