开发者

How do I set a specific printer for a report?

开发者 https://www.devze.com 2022-12-08 07:03 出处:网络
I want to print a customized report to a specific printer, bypassing the print dialog. The printer is to be selected by the user for each report template.

I want to print a customized report to a specific printer, bypassing the print dialog. The printer is to be selected by the user for each report template.

Right now I have the code to print the report showing the print dialog, or directly to the default printer. I need to change it in order to print directly to a printer which is not necessari开发者_如何学Pythonly the default one.

I realize that calling SetDefaultPrinter before printing is an easy solution, but it's not thread-safe.

Note: I'm using C++/MFC.


Another article from Microsoft's KB: How to programmatically print to a non-default printer in MFC


Perhaps this might prove a bit helpful

0

精彩评论

暂无评论...
验证码 换一张
取 消