"Go" javascript print settings

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.