javascript - JS print Setup - Select System Paper Size? - Stack Overflow

I need to print a page in custom Paper Size as defined in the System (Windows) Printer and Faxes.I am

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 badges
Add a ment  | 

2 Answers 2

Reset to default 2

For 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744486553a4576594.html

相关推荐

  • javascript - JS print Setup - Select System Paper Size? - Stack Overflow

    I need to print a page in custom Paper Size as defined in the System (Windows) Printer and Faxes.I am

    2天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信