This article mainly introduces the implementation of window in javascript. print () the method for removing the header and footer and the setting skills of each parameter. If you need to add the following code before removing the header and footer during printing, You Can var HKEY_Root, HKEY_Path, HKEY_Key;
The Code is as follows:
HKEY_Root = "HKEY_CURRENT_USER ";
HKEY_Path = "\ Software \ Microsoft \ Internet Explorer \ PageSetup \\";
Var head, foot, top, bottom, left, right;
Var Wsh = new ActiveXObject ("WScript. Shell ");
HKEY_Key = "header ";
// Set the header (empty) according to your own settings
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key ,"");
HKEY_Key = "footer ";
// Set the footer (empty) according to the settings you want to set
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key ,"");
HKEY_Key = "margin_bottom ";
// Set the bottom margin (0) based on the settings you want to set
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key, "0 ");
HKEY_Key = "margin_left ";
// Set the left margin (0) based on the settings you want to set
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key, "1 ");
HKEY_Key = "margin_right ";
// Set the right margin (0)
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key, "0 ");
HKEY_Key = "margin_top ";
// Set the top margin (8)
Wsh. RegWrite (HKEY_Root + HKEY_Path + HKEY_Key, "1 ");