惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
T
Tenable Blog
博客园_首页
S
Securelist
Spread Privacy
Spread Privacy
Google Online Security Blog
Google Online Security Blog
Forbes - Security
Forbes - Security
Engineering at Meta
Engineering at Meta
U
Unit 42
L
LINUX DO - 热门话题
量子位
T
Threat Research - Cisco Blogs
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Martin Fowler
Martin Fowler
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Latest
Security Latest
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
T
Tailwind CSS Blog
月光博客
月光博客
Recent Announcements
Recent Announcements
G
Google Developers Blog
F
Full Disclosure
W
WeLiveSecurity
宝玉的分享
宝玉的分享
腾讯CDC
G
GRAHAM CLULEY
Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
美团技术团队
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security

博客园 - Allen Zhang

oracle数据库的字符集更改 用SQL server导出到oracle,查询时提示“表或视图不存在ORA-00942”错误 由于无法创建应用程序域,因此未能执行请求。错误: 0x80070002 系统找不到指定的文件 导出Excel时发生COM组件失败的解决方案 jquery下一个空格带来的血案 Web应用系统中关闭Excel进程 C++数据类型与C#对应关系 c#调用WINDWOS API时,非常有用(转) 水晶报表的交叉表中增加超级链接 JavaScript和ExtJS的继承 Ext.extend Ext.applyIf (转) SQL SERVER 2000数据库置疑处理 给ASP.net程序配置代理服务器 使用jQuery的validation后,无法引发asp.net按钮的事件处理程序 使用代码模拟请求和提交网页数据 - Allen Zhang - 博客园 C#调用Delphi写的动态链接库 - Allen Zhang - 博客园 近期一些超值文章及工具收集 用STSADM工具全自动备份sharepoint站点 创建MOSS网站下的新闻 SQL Server Reporting Services与MOSS集成资料汇总 修复MOSS2007备份还原后搜索服务出现的问题(续) - Allen Zhang - 博客园
ScriptX控件部分参数说明 - Allen Zhang - 博客园
Allen Zhang · 2009-08-30 · via 博客园 - Allen Zhang

在Web项目中经常要用到打印功能,我现在使用的是ScriptX,基本功能是免费的(高级功能收费)
在网页中嵌入:
<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="hppt://url/smsx.cab#Version=6,4,438,06"></object>

这里备注一些常用的javascript功能控制:

<script defer>
// -------------------基本功能,可免费使用-----------------------
factory.printing.header = "";//页眉
factory.printing.footer = "";//页脚
factory.printing.SetMarginMeasure(1);//页边距单位,1为毫米,2为英寸

//边距设置,需要注意大部分打印机都不能进行零边距打印,即有一个边距的最小值,一般都是6毫米以上
//
设置边距的时候时候如果设置为零,就会自动调整为它的最小边距
factory.printing.leftMargin = 7;//左边距
factory.printing.topMargin = 7;//上边距
factory.printing.rightMargin = 7;//右边距
factory.printing.bottomMargin = 7;//下边距
factory.printing.portrait = true;//是否纵向打印,横向打印为false

//--------------------高级功能---------------------------------------------
factory.printing.printer = "EPSON LQ-1600KIII";//指定使用的打印机

//
factory.printing.printer = "\\\\cosa-data\\HPLaserJ";//如为网络打印机,则需要进行字符转义
factory.printing.paperSize = "A4";//指定使用的纸张
factory.printing.paperSource = "Manual feed";//进纸方式,这里是手动进纸
factory.printing.copies = 1;//打印份数
factory.printing.printBackground = false;//是否打印背景图片
factory.printing.SetPageRange(false13); //打印1至3页

//---------------------常用函数--------------------------------
factory.printing.Print(false);//无确认打印,true时打印前需进行确认
//
factory.printing.Print(false, pageFrame); pageFrame为Iframe或Frame框架名称,只打印框架内容
factory.printing.PrintSetup();//打印设置
factory.printing.Preview();//打印预览
factory.printing.WaitForSpoolingComplete();//等待上一个打印任务完全送入打印池,在连续无确认打印时非常有用
factory.printing.EnumPrinters(index);//枚举已安装的所有打印机,主要用于生成打印机选择功能
</script>