怎么很好的打印?
?
------解决方案--------------------利用IE本身的打印就可以打的很好:)
------解决方案-------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html>
<head>
<title> Untitled Document </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body> <SCRIPT LANGUAGE= "JavaScript ">
<!-- Begin
if (window.print) {
document.write( ' <form> 不在忘记 '
+ ' <input type=button name=print value= "Print " '
+ 'onClick= "javascript:window.print() "> 本页! </form> ');
}
// End -->
</script>
</body>
</html>
------解决方案--------------------很早前收集的,原作者不知道是谁了
——————
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> print </title>
<SCRIPT language= "VBScript ">
dim hkey_root,hkey_path,hkey_key
hkey_root= "HKEY_CURRENT_USER "
hkey_path= "\Software\Microsoft\Internet Explorer\PageSetup "
function pagesetup_null()
on error resume next
Set RegWsh = CreateObject( "WScript.Shell ")
hkey_key= "\header "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, " "
hkey_key= "\footer "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, " "
hkey_key= "\margin_bottom "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, "0.75 " //控制 "纵打 "、 横打”和“页面的边距。
hkey_key= "\margin_left "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, "0.75 "
hkey_key= "\margin_right "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, "0.75 "
hkey_key= "\margin_top "
RegWsh.RegWrite hkey_root+hkey_path+hkey_key, "0.75 "
end function
</SCRIPT>
</head>
<body onload= "pagesetup_null() ">
<p> 测试打印 </p>
<p> 测试打印 </p>
<p> 测试打印测试打印测试打印 </p>
<p> </p>
<p>
<input type= "button " name= "Submit " value= "打印 " onclick= "JavaScript:window.print(); " />
<input type= "button " name= "Submit2 " value= "打印设置 " onclick= "JavaScript:window.focus();WebBrowser1.ExecWB(8,1); " />
<br/>
以下为比较全的打印js <br/>
<input type=button value=打开 onclick= "JavaScript:window.focus();document.all.WebBrowser1.ExecWB(1,1); " />
<input type=button value=另存为 onclick= "JavaScript:window.focus();document.all.WebBrowser1.ExecWB(4,1); " />
<input type=button value=全选 onclick= "JavaScript:window.focus();document.all.WebBrowser1.ExecWB(17,1); " />
<input type=button value=属性 onclick= "JavaScript:window.focus();document.all.WebBrowser1.ExecWB(10,1); " />
<input type=button value=关闭窗口 onclick= "JavaScript:window.focus();document.all.WebBrowser1.ExecWB(45,1); " />