The code in the page:
<object id= "WebBrowser1" height= "0" width= "0"
Classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" viewastext>
</OBJECT>
Related js:
var hkey_root, Hkey_path, Hkey_key
Hkey_root = "HKEY_CURRENT_USER"
Hkey_path = "\\Software\\Microsoft\\Internet explorer\\pagesetup\\"
Set Header Footer page margins
function Pageprintsetup () {
try {
var regwsh = new ActiveXObject ("Wscript.Shell");
Hkey_key = "header";//Page
Regwsh.regwrite (hkey_root + Hkey_path + hkey_key, "");
Hkey_key = "Footer";
Regwsh.regwrite (hkey_root + Hkey_path + hkey_key, "");
Hkey_key = "Margin_top";//The 0.75 in the registry corresponds to 19.05 of the page
Regwsh.regwrite (hkey_root + Hkey_path + hkey_key, "0.15");
Margin_bottom
Margin_left
Margin_right
}
catch (e) {}
}
function Fn_winprint () {
Document.all.tab_PrintButton.style.display = ' None ';
try {
Pageprintsetup ();
DOCUMENT.ALL.WEBBROWSER1.EXECWB (6, 1);
}
catch (Err) {
Window.print ();
}
Document.all.tab_PrintButton.style.display = ' block ';
return false;
}
"Go" javascript print settings