0

我正在尝试使用以下代码通过 .NET 打印....

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);
    }
}

打印机对话框窗口打开,打印作业在队列中,但是,没有任何打印内容……我可以打印。

4

1 回答 1

1

在这里查看Print()扩展方法:https ://stackoverflow.com/a/5751106/353147

于 2012-04-03T22:30:15.810 回答