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
window.print() vs ctrl+p
-
- 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:
-
- 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
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:
Does that help?
Code: Select all
parent.window.focus(); window.print();
-
- 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
It was worth a try man, but it did not work. Thanks for your help.
Who is online
Users browsing this forum: No registered users and 0 guests