我想用 PrintDocument
打印一个非常简单的布局适合一页,所以不需要 DocumentPaginator
.但是我想使用 PrinterDialog
选择打印机。我看到了 PrinterSettings
的例子是 PrinterDialog
的属性(property)它被简单地分配给 PrintDocument
.但这似乎不再可能了。我还寻找了其他解决方案,例如要使用的自定义分页器类,但结果是空的。我可能对 WPF 没有如此深入的了解,但为什么它必须始终以这种方式加密...
最佳答案
尝试这个:
System.Printing
PrintDialog
进而:
PrintDialog printDialog = new PrintDialog();
printDialog.PrintQueue = new PrintQueue(new PrintServer(), "PrinterName");
printDialog.PrintDocument(document, "PrintDocument");
关于WPF:有没有办法只使用 PrintDialog 来选择目标打印机而不必提供 DocumentPaginator 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16016874/