![]() ![]() P.PrintPage += delegate(object sender1, PrintPageEventArgs e)Į.Graphics.DrawString("testtesttestest", new Font("Times New Roman", 12), new SolidBrush(Color.Black), new RectangleF(0, 0, p., p.DefaultPageSettings.PrintableArea. ![]() P.PrinterSettings.PrinterName = "Star HSP7000 Receipt" Other than reprinting the document or a blank document to the previously default printer. I figure there might be a simple way to change it back using the same Namespace that used it in the first place. But did not find anything related to changing the default printer back in the Namespace. I did some reading on changing the default printer, the solutions I found seemed to use the System.Management Namespace. I have to assume it is happening inside the Print() method. I thought maybe at first maybe the PrinterName property was setting the default printer, and quickly realized that is not the case. But I have notices upon completing the print, the systems default printer has changed. Windows 11 supports most printers, so you probably won't have to install special printer software. The code sends the print to the correct printer. Install a printer in Windows Windows 11 Windows 10 When you connect a printer or scanner to your PC or add a new printer or all-in-one device to your home network, you can usually start printing right away. I have the following code, to test out printing to a specific printer. ![]()
0 Comments
Leave a Reply. |