如何设置从javascript打印的份数 [英] How to set the number of copies to print from javascript

查看:971
本文介绍了如何设置从javascript打印的份数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用javascript的print方法打印文档。
现在我想设置要打印的份数(默认情况下会打印1份)。我想将份数设置为2份(2份)。

I am trying to print a document using print method of javascript. Now i want to set number of copies to print(by default it will print 1 copy).i want to set the number of copies to two(2 copies).

是否可以通过js代码进行设置。我们可以通过打印机设置进行设置,但它会打印所有副本。我需要它才能打印2份特定文件。

Is it possible to do it from js code.We can set by printer settings,but it will print for all the copies.I need it for specific document to print 2 copies.

我的代码是:

  $scope.printPDF = function (id) {       
    window.frames["doc1"].focus();
    window.frames["doc1"].print();
    window.frames["doc2"].focus();
    window.frames["doc2"].print();
    window.frames["doc3"].focus();
    window.frames["doc3"].print();

};

现在我想将doc2(only doc2)打印为2份.remaining应该是默认值1复制。

Now i want to print doc2("only doc2") as 2 copies.remaining should be default 1 copy.

提前致谢。

推荐答案

没有额外的 window.print()方法的参数,绝对没有允许您指定默认份数的参数。

There are no additional parameters for the window.print() method and definitely no parameter that allows you to specify the default number of copies.

我能想到的唯一解决方法是在doc2上调用 print()方法两次。显然不是最好的用户体验。

The only workaround for this that I can think of would be to call the print() method twice on doc2. Obviously not the greatest user experience.

这篇关于如何设置从javascript打印的份数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆