Send a printout directly to a specific printer in C#

This program uses the following code to print directly to the printer named "Dell Photo AIO Printer 926."

// Print.
private void btnPrint_Click(object sender, EventArgs e)
{
// Select the printer.
pdocSmiley.PrinterSettings.PrinterName = "Dell Photo AIO Printer 926";

// Print.
pdocSmiley.Print();
}

The code first sets the PrinterSettings object's PrinterName property to select the printer. It then calls the PrintDocument object's Print method to immediately send the printout to that printer.

   

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.