我是要做一个条码打印 条码纸有的是一行2个 有的是一行1个 现在我打印的条码出来以后 一行和一行之间 总是存在一段空白 这样浪费了好多标签纸 我的代码是这样写的<script type="text/javascript">
var hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER";
hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//这个是用来设置打印页眉页脚的,你可以设置为空或者其它
try{
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,"");
}catch(e){
alert(e.description());
}
</script>
<p class="noprint">
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 ></OBJECT>
<input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
<input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6) />
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1) />
<input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1) />
<br />
</p>
var hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER";
hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//这个是用来设置打印页眉页脚的,你可以设置为空或者其它
try{
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,"");
}catch(e){
alert(e.description());
}
</script>
<p class="noprint">
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 ></OBJECT>
<input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,1)>
<input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6) />
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1) />
<input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1) />
<br />
</p>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货