Tag Archives: PrintDocument

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 data in rows and columns in C#

This example shows how you can print data in rows and columns with column headers. The example uses the following code to initialize the data. // The sample data. private string[] Headers = {“Name”, “Street”, “City”, “State”, “Zip”}; private string[,] … Continue reading

Posted in graphics, printing | Tagged , , , , , , , , , , , , , , | 5 Comments

Provide printing and print previews with advanced features for Windows Forms applications in C#

The example Provide print previews and printing for Windows Forms applications in C# shows how to create a basic printout by handling a PrintDocument object’s PrintPage event. This example shows how to use two other PrintDocument events: BeginPrint and QueryPageSettings. … Continue reading

Posted in graphics, printing | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Provide print previews and printing for Windows Forms applications in C#

This example shows how you can support print previews and printing for a Windows Forms application in C#. A PrintDocument plays a central role in printing and print previews. It raises its PrintPage event to generate graphics for printing. A … Continue reading

Posted in graphics, printing | Tagged , , , , , , , , , , , , , , , | 4 Comments