// 检测是否是IE 如果是ie去除页眉页脚
if (IEVersion() !== -1) {
var hkey_key
var hkey_root = ‘HKEY_CURRENT_USER’
var hkey_path = ‘\Software\Microsoft\Internet Explorer\PageSetup\’
try {
// eslint-disable-next-line no-undef
var RegWsh = new ActiveXObject(‘WScript.Shell’)
hkey_key = ‘header’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘’)
hkey_key = ‘footer’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘’)
// 设置下页边距(0) 根据你自己要设置的填入
hkey_key = ‘margin_bottom’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘0’)
// 设置左页边距(0) 根据你自己要设置的填入
hkey_key = ‘margin_left’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘0’)
// 设置右页边距(0)
hkey_key = ‘margin_right’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘0’)
// 设置上页边距(0)
hkey_key = ‘margin_top’
RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, ‘0’)
} catch (e) {
console.log(’【e】:’, e)
}
}