• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

edabg/jsprintsetup: JSPrintSetup Firefox addon

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

edabg/jsprintsetup

开源软件地址:

https://github.com/edabg/jsprintsetup

开源编程语言:

JavaScript 100.0%

开源软件介绍:

JS Print Setup Firefox Addon

JS Print Setup Firefox addon allows client side Javascript manipulate printer settingsand control print process. This extension implements print setup from CS Javascript, similar of MeadCo's ScriptX ActiveX control for Internet Explorer. Extension creates global object called 'jsPrintSetup', which implements methods to get/set print Page Setup options. This is useful for developers who wants to control page setup options from their Javascript code.

Features

  • Get/Set print settings - margins, orientation, scaling, header and footer
  • Get/Set global print settings and for selected printer
  • Working with installed printers
  • Save print settings to user preferences
  • Print with current setttings without need from saving to user pereferences as required from 'window.print()'
  • Print desired window or frame
  • Unattended printing without print dialog
  • Enhanced Paper data handling
  • Host based Security Access Control

Important Note!

If your application is not conformable with jsPrintSetup access control, most of features of jsPrintSetup will be inaccessible if user who is using application block access to jsPrintSetup on first request for permission. Your application must implement these methods to get information about user's decision and rerequest permissions if needed or get alternate decision.

Example

Sample code which demonstrate using of JSPrintSetup to setup print margins and call unattended print method (without print dialog).

// set portrait orientation
jsPrintSetup.setOption('orientation', jsPrintSetup.kPortraitOrientation);
// set top margins in millimeters
jsPrintSetup.setOption('marginTop', 15);
jsPrintSetup.setOption('marginBottom', 15);
jsPrintSetup.setOption('marginLeft', 20);
jsPrintSetup.setOption('marginRight', 10);
// set page header
jsPrintSetup.setOption('headerStrLeft', 'My custom header');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '&PT');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// Suppress print dialog
jsPrintSetup.setSilentPrint(true);
// Do Print
jsPrintSetup.print();
// Restore print dialog
jsPrintSetup.setSilentPrint(false);

Reference

The reference of JS Print Setup can be found at wiki

Installation from Mozilla Addon Page

JS Print Setup addon page




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap