public static void PrintDocument()
{
// Allow the user to choose a printer and specify other settings.
PrintDialog dlgSettings = new PrintDialog();
dlgSettings.Document = printingDocument;
// If the user clicked OK, print the document.
if (dlgSettings.ShowDialog() == DialogResult.OK)
{
// This method returns immediately, before the print job starts.
// The PrintPage event will fire asynchronously.
printingDocument.Print();
}
}