Tag Archives: printing

Print a ListView with large contents in C#

The example Print the contents of a ListView control in C# explains how to print the data in a ListView control when its View property is set to Details. One difficulty when printing this kind of data is that a … Continue reading

Posted in controls, drawing, graphics, printing | Tagged , , , , , , , , , , , , , , | Leave a comment

Print the contents of a ListView control in C#

The ListView control, like most controls, includes no support for printing. If you want to display a ListView control’s contents on a print out, you need to do all of the printing yourself. Unfortunately printing in C# is extremely flexible … Continue reading

Posted in controls, drawing, graphics, printing | Tagged , , , , , , , , , , , , | 24 Comments

Select and print multiple files in C#

This example lets you easily print multiple files. You can use it, for example, to print all of the .cs files in a project’s directory. Select a printer from the ComboBox at the top. Enter or select a directory and … Continue reading

Posted in files, printers, printing, system | Tagged , , , , , , , , , , , , | 11 Comments

Set a print job name in C#

By default, when you send a PrintDocument to a printer, the printer spool shows the job’s name as “document.” You can change the print job name by setting the PrintDocument object’s DocumentName property. This example uses the following code to … Continue reading

Posted in printers, printing, system | Tagged , , , , , , , , , , , , , | 1 Comment

Determine the default printer in C#

When this example starts, the following code lists the printers and selects the default printer. private void Form1_Load(object sender, EventArgs e) { // Find all of the installed printers. foreach (string printer in PrinterSettings.InstalledPrinters) { cboPrinter.Items.Add(printer); } // Find and … Continue reading

Posted in printing, system | Tagged , , , , , , , , , | 3 Comments

Print a text file in C#

This example lets you select a printer and file, and then print the file on the selected printer. (Actually this version just displays a print preview. To send the file directly to the selected printer, see the example Send a … Continue reading

Posted in printers, printing, system | Tagged , , , , , , , , , , , , , , , , , | 2 Comments

Print a Celsius to Fahrenheit conversion chart in C#

A friend of mine cooks a lot using Japanese cookbooks. Because ovens in the United States only display temperature in degrees Fahrenheit (someone should make that a switch on the oven), she needs to convert temperatures from Celsius to Fahrenheit. … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Restart the print spooler in C#

Every now and then my computer gets confused and thinks the printer is offline. That wouldn’t be so bad except Windows doesn’t provide a simple way to bring the printer back online. Basically you need to shutdown and restart the … Continue reading

Posted in printing, system | Tagged , , , , , , , , , , | 8 Comments

A quick note about the .NET Graphics book Kickstarter

Several people have told me, “I will definitely buy the book when it’s finished.” Unfortunately that’s not the way Kickstarter works. You need to sign up now to receive a copy of the book. If we reach the project goal, … Continue reading

Posted in algorithms, drawing, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , | Leave a comment

The graphics book Kickstarter Campaign is live!

This campaign is now live until January 31, 2016! Follow the link below to see the project description, explanatory video, and other details. .NET Graphics Programming Omnibus This book will cover a large number of topics in .NET graphics programming … Continue reading

Posted in algorithms, books, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , | Leave a comment