Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print page automatically when related page is printed

Status
Not open for further replies.

luvfool313

Technical User
Apr 12, 2002
3
0
0
US
Is there a way to print an associated page automatically when the user selects to print one page of a PDF document? Say if the user wants to print page 5 out of a 30 page document, and there's relevant info on page 25, can I somehow set it so that page 25 prints automatically whenever page 5 is printed? Do I use Javascript to do this or do I need a plug-in? Any input on this would be greatly appreciated!! :eek:)
 
I would do it this way (there may be and probably is a better way!!).
The example below will print off page 5 and page 25 of the document.

Create a text only button with "Print" as the text, then assign the following javascript to MouseUp action of the button -

Code:
this.print(false, 4, 4);
this.print(false, 24, 24);

The only annoting thing is that the first page in the document is referred to as page 0, not page 1, so you have to take 1 from the page number that you want to print. If you wanted to print a range of pages, say 5 to 25 then you would put -

Code:
this.print(false, 4, 24);

The 'false' value sends it to the default printer without opening a dialog box - if you want this to appear put 'true' in instead.

Hope this helps.

Ahhhhh, I see you have a machine that goes Bing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top