如何设置份数getPrintParams() [英] How to set number of copies getPrintParams()
问题描述
我正在尝试在pdf创建过程中添加一些JS,以节省一些时间.我的目标是基本上单击一个按钮即可生成PDF并进行打印.
I am trying to add some JS to my pdf creation process to save some time. My goal is to basically click a button generate a PDF and have it print.
现在我有:
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.full;
this.print(pp);
Right now I have:
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.full;
this.print(pp);
唯一的问题是我不知道如何设置要打印的份数.我想传递一个变量并打印那么多份.问题是我找不到真正的文档来讨论此类中的方法.
The only problem is that I don't know how to set the number of copies to print. I want pass a variable and print that many copies. The problem is that I can't really find any documentation discusses the methods in this class.
推荐答案
我知道,这个问题很旧.但是我也在寻找解决方案.我发现此处,它应该与以下内容一起工作:
I know, this question is old. But I was looking for a solution, too. And I found here, that it should work with the following:
//no of copies
var n = 3;
var pp = this.getPrintParams();
//here is the magic
pp.NumCopies=eval(n);
this.print(pp);
对我来说,这可与tcpdf和Adobe Reader一起使用.
For me, this is working with tcpdf and Adobe Reader.
这篇关于如何设置份数getPrintParams()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!