Print to a specific printer slot

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Print to a specific printer slot

Post by apx »

In the C# Demo FullDemo there is an example for printing PDF files with different settings. However, I don't have the setting to address a particular printer slot. Is that possible by any chance?

Tia
Alex
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Print to a specific printer slot

Post by Sasha - Tracker Dev Team »

Hello Alex,

How about this piece of code from FullDemo:

Code: Select all

opts["PrinterName"].v = cbPrinter.Text;
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Re: Print to a specific printer slot

Post by apx »

I mean setting the Papersource for Printer that has more than one source for Paper.

Image

We have the Value "Paper.Name" with the same structure, the paper source would then have to be set by

Code: Select all

opts["Paper.Source"].v = "Tray1";
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Print to a specific printer slot

Post by Sasha - Tracker Dev Team »

Hello apx,

Try catching the e.operBeforeExecute and if that the op.printPages operation then get the operation parameters (use forum search - plenty of examples there) and modify this one:

Code: Select all

op.Params[L"Options.Tray"] = myTray; // index of page-source
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Re: Print to a specific printer slot

Post by apx »

Thanks, I will try it.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Print to a specific printer slot

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply