0

I am trying to print via .NET with the following code....

http://support.microsoft.com/kb/322091

OpenFileDialog ofd = new OpenFileDialog();
if( DialogResult.OK == ofd.ShowDialog(this) )
{
    // Allow the user to select a printer.
    PrintDialog pd  = new PrintDialog();
    pd.PrinterSettings = new PrinterSettings();
    if( DialogResult.OK == pd.ShowDialog(this) )
    {
        // Print the file to the printer.
        RawPrinterHelper.SendFileToPrinter(pd.PrinterSettings.PrinterName, ofd.FileName);
    }
}

The printer dialog window opens, and the print job is in the queue, however, nothing prints... and I can print otherwise.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
jroberts
  • 449
  • 1
  • 5
  • 13

1 Answers1

1

See the Print() extension method here: https://stackoverflow.com/a/5751106/353147

Community
  • 1
  • 1
Chuck Savage
  • 11,775
  • 6
  • 49
  • 69