星期五, 10月 31, 2008

安裝Meadroid的ScriptX

Step1.下載smsx.cab
載點:smsx.cab
進入後的畫面如下
有兩個載點,一個是可測試完整的功能
另一個就是直接載smsx.cab,後面有說明,記得改version到6,4,xxx


下載smsx.cab後
將檔案放到你自己指定的Server位置

Step2.在網頁的body放入Object
<!-- MeadCo Security Manager -->
<object style="display: none;" classid="clsid:5445be81-b796-11d2-b931-002018654e2e" codebase="http://[your path here]/smsx.cab#Version=6,4,438,06">
<param name="GUID" value="{19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E}">
<param name="Path" value="http://[your path here]/sxlic.mlf">
<param name="Revision" value="0">
</object>
<!-- MeadCo ScriptX -->
<object id="factory" style="display: none;" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>


Step3.設定參數
這裡有兩個地方需設定
codebase及param的Path
其中codebase指定到剛你設定的[Server Url/smsx.cab]位置

而Path要放的是MeadCo的unique publishing license(即sxlic.mlf的位置)
只是用免費的功能話 就可以把拿掉Path及Revision這兩行拿掉
<!-- MeadCo Security Manager -->
<object style="display: none;" classid="clsid:5445be81-b796-11d2-b931-002018654e2e" codebase="http://[your path here]/smsx.cab#Version=6,4,438,06">
<param name="GUID" value="{19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E}">
<param name="Path" value="http://[your path here]/sxlic.mlf">
</object>


Step4.自定列印畫面配置
用完就可以開心的用免費版的功能
<script defer>
window.onload=function(){
factory.printing.portrait = true; //直印,false:橫印
factory.printing.header = ""; //頁首,空白為不印頁首,也就不會佔空間
factory.printing.footer = ""; //註腳,空白為不印註腳,也就不會佔空間
factory.printing.leftMargin = 0; //左邊界
factory.printing.topMargin = 0; //上邊界
factory.printing.rightMargin = 0; //右邊界
factory.printing.bottomMargin = 0; //下邊界
}
</Script>

1 則留言:

angus 提到...

所以這個元件可以套用各種紙張大小窩