1 public static void PrintwithoutDialog(this DocumentViewer viewer, FixedDocument fixedDoc)
2         {
3             PrintDialog pDialog = new PrintDialog();
4             pDialog.PageRangeSelection = PageRangeSelection.AllPages;
5             pDialog.UserPageRangeEnabled = false;
6             pDialog.PrintDocument(fixedDoc.DocumentPaginator, "Test print job");
7         }

参考 https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.controls.printdialog.showdialog?view=net-5.0#System_Windows_Controls_PrintDialog_ShowDialog

javascript:void(0)