window.print() vs ctrl+p

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rict
New User
Posts: 9
Joined: Tue May 05, 2015 9:23 am
First Name: Ric
Last Name: Turner
Company Name: Jano Technologies, Inc.
State / Province: Mississippi
Country: United States
Contact:

window.print() vs ctrl+p

Post by rict »

I have a button on the screen that is running in an iFrame. When I click the button, the on-click code executes window.print() and the print preview screen appears with just the contents of the iframe. When I press ctrl+p, the print preview appears but it shows the entire screen (the iframe and everything around it).

How can I make my print button work like the ctrl+p?

Thanks,
Ric
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: window.print() vs ctrl+p

Post by Scott Klement »

I have never done this, myself... but with a quick Google search I found a suggestion that if you first give focus to the parent of the iframe, you can print the whole page. To try this, set your onclick code like this:

Code: Select all

parent.window.focus(); window.print();
Does that help?
rict
New User
Posts: 9
Joined: Tue May 05, 2015 9:23 am
First Name: Ric
Last Name: Turner
Company Name: Jano Technologies, Inc.
State / Province: Mississippi
Country: United States
Contact:

Re: window.print() vs ctrl+p

Post by rict »

It was worth a try man, but it did not work. Thanks for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest