WEB列印的實現方法 VBScript
阿新 • • 發佈:2019-01-08
<object id="Factory" style="display:none" viewastext
codeBase=http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360
classid=clsid:1663ed61-23eb-11d2-b92f-008048fdd814 viewastext>
</object>
<input type="button" value="打 印" onclick="Factory.printing.Print(true)">
<input type="button" value="頁面設定" onclick="Factory.printing.PageSetup()">
<input type="button" value="列印預覽" onclick="Factory.printing.Preview()">
<input type="button" value="橫向設定" onclick="SetPrintSettings()">
<script>
function SetPrintSettings()
{
try
{
Factory.printing.SetMarginMeasure(2);
Factory.SetPageRange(false,1,3);
Factory.printing.printer="HP DeskJet 870C";
Factory.printing.copies=2;
Factory.printing.collate=true;
Factory.printing.paperSize="A4";
Factory.printing.paperSource="Manual feed";
Factory.printing.header="This is MeadCo";
Factory.printing.footer="Advanced Printing by ScriptX";
Factory.printing.portrait=false;
Factory.printing.leftMargin=1.0;
Factory.printing.topMargin=1.0;
Factory.printing.rightMargin=1.0;
Factory.printing.bottomMargin=1.0;
}
catch(e)
{}
}
</script>
codeBase=http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360
classid=clsid:1663ed61-23eb-11d2-b92f-008048fdd814 viewastext>
</object>
<input type="button" value="打 印" onclick="Factory.printing.Print(true)">
<input type="button" value="頁面設定" onclick="Factory.printing.PageSetup()">
<input type="button" value="列印預覽" onclick="Factory.printing.Preview()">
<input type="button" value="橫向設定" onclick="SetPrintSettings()">
<script>
function SetPrintSettings()
{
try
{
Factory.printing.SetMarginMeasure(2);
Factory.SetPageRange(false,1,3);
Factory.printing.printer="HP DeskJet 870C";
Factory.printing.copies=2;
Factory.printing.collate=true;
Factory.printing.paperSize="A4";
Factory.printing.paperSource="Manual feed";
Factory.printing.header="This is MeadCo";
Factory.printing.footer="Advanced Printing by ScriptX";
Factory.printing.portrait=false;
Factory.printing.leftMargin=1.0;
Factory.printing.topMargin=1.0;
Factory.printing.rightMargin=1.0;
Factory.printing.bottomMargin=1.0;
}
catch(e)
{}
}
</script>