列印控制元件 ScriptX
1.先下載.cab檔 並放置在網頁資料夾
http://www.meadroid.com/scriptx/sxdownload.asp
2.輸入以下程式
<OBJECT id=factory style="DISPLAY: none" codeBase=http://127.0.0.1/smsx.cab#Version=6,4,438,06 classid=clsid:1663ed61-23eb-11d2-b92f-008048fdd814 VIEWASTEXT>
</OBJECT>
<script>
function printWindow( ) {
//document.Form1.Print.style.visibility = "hidden";
factory.printing.header = "頁首文字";
factory.printing.footer = "頁尾文字";
factory.printing.portrait = true; // true為縱向列印,flase為横向列式
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
factory.printing.Print(false);
//printBase("&w&b頁碼,&p/&P","&u&b&d"); //預設
//window.print();
factory.printing.Preview(); //預覽
//factory.printing.Print(false); // false為預設印表機 , true為選擇列表機
}
</script>
■ 輸入正確的版本及cab檔案位址