Jump to content

print preview problem


raefy2

Recommended Posts

i have the problem about the script below.... i used localhost it running well... but after go to the prodcution....i have the problem with preview..it cant show as same like word printpreview.. it active x control bar and page not preview not fit... i think it because of linux based server i have used... pleasehelp me or email to my email [email protected]

 

<script>

function printpreview()

{

 

 

var OLECMDID = 7;

/* OLECMDID values:

* 6 - print

* 7 - print preview

* 1 - open window

* 4 - Save As

*/

var mydoc = document.getElementById('popup_schedule').innerHTML;

var PROMPT = 1; // 2 DONTPROMPTUSER

var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"  ></OBJECT>';

 

document.getElementById('schedule').style.display='none';

document.getElementById('popup_schedule').style.display='';

 

document.body.insertAdjacentHTML('beforeEnd',WebBrowser);

WebBrowser1.ExecWB(OLECMDID, PROMPT);

WebBrowser1.outerHTML = "";

 

document.getElementById('schedule').style.display='';

document.getElementById('popup_schedule').style.display='none';

}

</script>

Link to comment
https://forums.phpfreaks.com/topic/56524-print-preview-problem/
Share on other sites

Try This:

 

<script>
function printpreview()
{


var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var mydoc = document.getElementById('popup_schedule').innerHTML;
var PROMPT = 1; // 2 DONTPROMPTUSER 
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"  ></OBJECT>';

document.getElementById('schedule').style.display='none';
document.getElementById('popup_schedule').style.display='';

document.body.insertAdjacentHTML('beforeEnd',WebBrowser); 
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";

document.getElementById('schedule').style.display='';
document.getElementById('popup_schedule').style.display='none';
}
</script>

<a href="javascript:printpreview()">Print Preview</a>

<div id="schedule"></div>
<br>
<div id="popup_schedule"></div>
<br>
<div id="beforeEnd"></div>

Link to comment
https://forums.phpfreaks.com/topic/56524-print-preview-problem/#findComment-281511
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.