admin管理员组文章数量:1384166
I need to print a page in custom Paper Size as defined in the System (Windows)/ Printer and Faxes.
I am using this FireFox Extension "JS Print Setup". I got through their documentation .html
It has function to get the System Printer List
jsPrintSetup.getPrintersList()
But I cannot find any functions that can get me the System Paper Sizes. The one the have is
jsPrintSetup.getPaperSizeList() // not getting system Paper Sizes :(
But it gives it's own paper sizes, not from the system.
So how can I select the system paper size through the extension or if that's not possible then create one in the extension?
Side note: I am using this extension because of its ability to silent print by selecting(through code) the printers and paper size (not happened yet).
I need to print a page in custom Paper Size as defined in the System (Windows)/ Printer and Faxes.
I am using this FireFox Extension "JS Print Setup". I got through their documentation http://jsprintsetup.mozdev/reference.html
It has function to get the System Printer List
jsPrintSetup.getPrintersList()
But I cannot find any functions that can get me the System Paper Sizes. The one the have is
jsPrintSetup.getPaperSizeList() // not getting system Paper Sizes :(
But it gives it's own paper sizes, not from the system.
So how can I select the system paper size through the extension or if that's not possible then create one in the extension?
Side note: I am using this extension because of its ability to silent print by selecting(through code) the printers and paper size (not happened yet).
Share Improve this question edited Aug 8, 2013 at 8:18 Ruchan asked Aug 8, 2013 at 6:58 RuchanRuchan 3,2047 gold badges40 silver badges73 bronze badges2 Answers
Reset to default 2For Now i could not find a way to use system Paper Sizes but did find a way to add new paper sizes to the jsPrintSetup.getPaperSizeList()
jsPrintSetup.definePaperSize(101, 101, "Custom", "Custom_Paper", "Custom PAPER", 250, 400,
jsPrintSetup.kPaperSizeMillimeters);
jsPrintSetup.setPaperSizeData(101);
According to the Documentation
void definePaperSize(in short jspid, in short pd, in wstring pn, in wstring pwg, in wstring name, in double w, in double h, in short m);
On different platforms and their printing subsystem paper definitions are different. jsPrintSetup is using own built-in list with paper definitions with own IDs and matching to platform specific IDs. You can view predefined list of paper definitions and use these which are most suitable for your case. (http://jsprintsetup.mozdev/reference.html#ENHANCED_PAPERHANDLING) For example if you want to use ISO A4 paper size you can call jsPrintSetup.setPaperSizeData(10); To use custom paper sizes you must first define in platform printing system and next to define in jsPrintSetup with correct paperData and paperName values. The simplest way to find them is to get it from about:config after manual print from Firefox to this paper. (print.printer_{your printer name}.paper_data and print.printer_{your printer name}.paper_name)
I hope that this will help you!
Regards,
Dimitar Angelov
本文标签: javascriptJS print SetupSelect System Paper SizeStack Overflow
版权声明:本文标题:javascript - JS print Setup - Select System Paper Size? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744486552a2608482.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论