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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 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>