我使用下面的代码直接在C#winform中打印文档
string fileName = @"D:\filename11" + ext; // Here ext is file extension
PrintDocument printDoc = new PrintDocument();
printDoc.DocumentName = fileName;
printDoc.Print();
此代码不起作用,打印空白页。请帮忙
答案 0 :(得分:3)
DocumentName属性未指定要打印的文件。而是通过处理PrintPage事件指定要打印的输出。有关示例,请参阅the PrintDocument class overview。