不使用插件实现横向打印
来源:互联网 发布:java从键盘输入数字 编辑:程序博客网 时间:2024/05/22 10:47
首先这段话就不用多解释了:
<object id="factory" style="display:none" viewastext
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360" ></object>
<input type=button value=页面设置 onclick="factory.printing.PageSetup()">
<input type=button value=打印预览 onclick="factory.printing.Preview()">
<script language=javascript>
function window.onload()
{
// -- advanced features
factory.printing.SetMarginMeasure(2) // measure margins in inches
factory.printing.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 = "居左显示&b居中显示&b居右显示页码,第&p页/共&P页"
factory.printing.footer = "(自定义页脚)"
factory.printing.portrait = false
factory.printing.leftMargin = 0.75
factory.printing.topMargin = 1.5
factory.printing.rightMargin = 0.75
factory.printing.bottomMargin = 1.5
}
它是能实现打印的一些基本功能,但是如果要实现打印的横向和纵向等一些方面,就需要按插件了,而且仅仅安了插件还不一定能行,好像还得改什么注册表什么的,如果不用它自带的属性来实现横向也许会更简单些:
可以在jsp页面放两个div层
<div id="zongxiang" style="margin-right: 5%;margin-top:10%;text-align: left;display: block;"> <tr> </table>
<table width="450" border="0" cellpadding="0" cellspacing="0">
<td align="center" width="100%">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
align="center">
<tr>
<td align="center">
<b><font size="5">纵向显示</font></b>
</td>
</tr>
</table>
</td>
</tr>
</div>
<div id="hengxiang" style="margin-right: 5%;margin-top:10%;text-align: left;display: none;">
<table width="450" border="0" cellpadding="0" cellspacing="0"
style="position: relative;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)">
<tr>
<td align="center" width="100%">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
align="center">
<tr>
<td align="center">
<b><font size="5">横向显示</font></b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
这两个div里面分别放的都是页面上要显示的内容,但第一个div的style="display:bloke;",第二个是display:none;并且第二个div里面style="position: relative;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"设置了整个table及其里面的内容都是横向的,点击打印时:
function print(){
document.getElementById('zongxiang').style.display='none';
document.getElementById('hengxiang').style.display='block';
document.all.wb.ExecWB(6,6);
document.getElementById('zongxiang').style.display='block';
document.getElementById('hengxiang').style.display='none';
}
打印出来就是横向的;
- 不使用插件实现横向打印
- Domino中实现横向打印功能
- 网页打印(不使用插件的情况下)
- WordPress不使用插件实现分页
- 使用UITableview实现横向滚动
- 使用RecyclerView实现横向WheelView
- jqprint打印插件使用
- 关于如何使用js 插件实现打印的功能
- 用 Delphi 实现报表的横向分组打印
- 用 Delphi 实现报表的横向分组打印
- jQuery打印插件PrintArea实现jQuery打印插件PrintArea实现
- jQuery打印插件PrintArea实现
- 使用HorizontalScrollView 实现ListView横向滑动
- 使用HorizontalScrollView实现横向滑动广告栏
- 横向纵向打印
- 横向打印二叉树
- 打印机默认横向打印
- Excel横向打印设置
- struts2 中 Actionsupport 的作用
- Changing the Framework version requires a restart of the W3SVC service.
- 使用libiconv库,解决多语言编码处理转换等应用问题
- 在Oracle中导出、导入dmp数据库文件
- ASP.NET Google Maps Javascript API V3 实战基础篇一自行车图层
- 不使用插件实现横向打印
- Tokyo Tyrant参数优化
- C#去除所有HTML标记
- Linux设备驱动程序之阻塞非阻塞IO----轮询操作
- /proc文件系统中网络参数详解
- chrome快捷键
- 鸟哥的linux私房菜学习
- /proc文件cpu相关
- 得到IFrame中的内容