js如何设置打印时是横打还是纵打?
在网上搜了一下,如下:(其中各种属性是什么意思))<scriptdefer>functionSetPrintSettings(){//--advancedfeatures...
在网上搜了一下,如下:(其中各种属性是什么意思)
)<script defer>
function SetPrintSettings() {
// -- advanced features
factory.printing.SetMarginMeasure(2) // measure margins in inches
factory.SetPageRange(false, 1, 3) // need pages from 1 to 3
factory.printing.printer = "HP DeskJet 870C"
factory.printing.copies = 2
factory.printing.collate = true
factory.printing.paperSize = "A4"
factory.printing.paperSource = "Manual feed"
// -- basic features
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
} 展开
)<script defer>
function SetPrintSettings() {
// -- advanced features
factory.printing.SetMarginMeasure(2) // measure margins in inches
factory.SetPageRange(false, 1, 3) // need pages from 1 to 3
factory.printing.printer = "HP DeskJet 870C"
factory.printing.copies = 2
factory.printing.collate = true
factory.printing.paperSize = "A4"
factory.printing.paperSource = "Manual feed"
// -- basic features
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
} 展开
2个回答
展开全部
factory.printing.header = "This is MeadCo" //页眉
factory.printing.footer = "Advanced Printing by ScriptX" //页脚
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.footer = "Advanced Printing by ScriptX" //页脚
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 //下页边距
其他的不要设置,请注意,第三个属性为横向
展开全部
这个是利用ScriptX的代码。需要下载ScriptX并安装。
就是通过ActiveX的调用,来实现相关的打印设置,
设置横打/纵打的那句,你那段里没有,
factory.printing.portrait = true; //--纵--
factory.printing.portrait = false; //--横--
ActiveX仅仅是在IE下,其它浏览器就不行了。
Chrome浏览器可用以下CSS代码实现:
@page{
size: landscape;
}
就是通过ActiveX的调用,来实现相关的打印设置,
设置横打/纵打的那句,你那段里没有,
factory.printing.portrait = true; //--纵--
factory.printing.portrait = false; //--横--
ActiveX仅仅是在IE下,其它浏览器就不行了。
Chrome浏览器可用以下CSS代码实现:
@page{
size: landscape;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询