Print by specifying the number of prints and the print size without displaying the printer selection dialog

Asked 2 years ago, Updated 2 years ago, 36 views

I have already created a program to display and print the printer selection dialog, but it takes time for manual operation, so I would like to know how to specify the printer, print size, and number of sheets by simply pressing the print button.Thank you for your cooperation.

Environment
Windows 10 Pro Visual Studio Community 2015 C#

c#

2022-09-29 20:29

1 Answers

If you are using the System.Drawing.Printing namespace in Windows Form, you can configure the PrintDocument to PrintSettings in advance.

//PrintDocument d;
d.PrintSettings.PrinterName="PrinterName";
d. PrintSettings.Copies = Number of copies;
d.DefaultPageSettings.PaperSize=Size;

d.Print();


2022-09-29 20:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.