This is a migrated thread and some comments may be shown as answers.

Pre-setting the number of copies in printer dialog

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 25 Apr 2017, 04:35 PM

I am using code Telerik provided to immediately send a report to the printer in my MVC app. Of course, the printer dialog still appears. When it does, I'd like the number of copies set to 2 for a particular report. I tried the code below, hoping it would work, but it didn't. Do you know how to preset the number of copies when the printer dialog appears?

            var deviceInfo = new System.Collections.Hashtable();
            deviceInfo["JavaScript"] = "this.print({bUI: true, bSilent: false, bShrinkToFit: true, Copies: 2});";

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 27 Apr 2017, 01:03 PM
Hello Randy,

According to the Acrobat DC SDK Documentation you can use NumCopies property of the PrintParams object to set the number of copies to be printed for this print job:
var pp = this.getPrintParams();
pp.DuplexType = pp.constants.duplexTypes.DuplexFlipShortEdge;
pp.NumCopies = 2;
this.print(pp);

You can check PrintParams properties (Acrobat DC SDK Documentation) for more detailed information.

I hope this will help.


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Randy
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or