在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:edabg/jsprintsetup开源软件地址:https://github.com/edabg/jsprintsetup开源编程语言:JavaScript 100.0%开源软件介绍:JS Print Setup Firefox AddonJS 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
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. ExampleSample 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); ReferenceThe reference of JS Print Setup can be found at wiki Installation from Mozilla Addon Page |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论