Forum Moderators: open

Message Too Old, No Replies

Print Preview

         

chrman

2:46 am on Jan 4, 2002 (gmt 0)



Is there a way that i can create a button that will act in the same manner as the print preview option in I.E.?
I already have a print button but since i have the menu hidden, i need to also replicate the function of the print preview as well.

Thanks

Brett_Tabke

1:29 pm on Jan 4, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I don't think so chrman.

Xoc

6:06 pm on Jan 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found code for it here [jguru.com].

chrman

9:45 pm on Jan 4, 2002 (gmt 0)



Thanks a ton.
I'm starting to figure this stuff out pretty good once someone points me in the right direction. I was able to add a line that would allow me to choose the main frame as the preview based on what i had learned from inserting my print button :)

chrman

7:21 pm on Jan 10, 2002 (gmt 0)



I have run into an issue with this function i was hoping that i could get help with.
The button is located on the bottom frame and the information i want to print is on the main frame. In I.E. 5.5, when i use the button, it previews ALL the frames with no option to print just the center frame and as a result it is more like a screen capture than a preview. In I.E 6, it has an option to select the frame desired in the preview window.

So the question is, is it possible to specifically target the center frame for previewing, or to add the option to pick the frame to the preview window like in 6.0?

The coding is below

function printpr()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";
}

<a href="javascript:;" onClick="parent.main.focus();printpr()">
<img src="printpreview.gif" border="0" width="129" height="35"></a>

chrman

2:41 pm on Jan 11, 2002 (gmt 0)



bump