web打印控制如何实现横向或纵向,请帮忙看一下。
<SCRIPT language=javascript>
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
var head,foot,top,bottom,left,right;
//取得页面打印设置的原参数数据
function PageSetup_Null()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
//设置页眉(为空)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
//设置页脚(为空)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="margin_bottom";
//设置下页边距(0)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.2");
HKEY_Key="margin_left";
//设置左页边距(0)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.35");
HKEY_Key="margin_right";
//设置右页边距(0)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.2");
HKEY_Key="margin_top";
//设置上页边距(8)
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.3");
}
catch(e){
alert("不允许ActiveX控件");
}
}
</script>
请问如何加入横幅向或纵向打印,请指教一下,在此谢了!
[解决办法]
本帖最后由 net_lover 于 2013-05-25 10:33:26 编辑
HKCU\Printers\DevModePerUser","打印机名称","值的0x4c
HKCU\Printers\DevModes2","打印机名称",值的0x4c
以上两处为打印机横向纵向,
可以参考这种方法
http://www.cnblogs.com/javaline/archive/2013/02/27/2935430.html
[解决办法]
注册表项目
Settings in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings key define printing preferences.
The following table shows the named values.
Value : typeDescription
PageOrientation : REG_DWORDSpecifies page orientation. Valid settings are 1=portrait, 2=landscape. Default setting is 1.