I want to print a very simple layout with PrintDocument
that fits on one page, so it doesn't require a DocumentPaginator
. However I want to use PrinterDialog
to select the printer. I saw examples with PrinterSettings
being a property of PrinterDialog
and it was simply assigned to the PrintDocument
. But this doesn't seem to be possible anymore. I also looked for other solutions like custom paginator classes to use but came up empty. I might not have this deep insight into WPF, but why must it always be dongled that way...
Try this:
System.Printing
PrintDialog
And then:
PrintDialog printDialog = new PrintDialog();
printDialog.PrintQueue = new PrintQueue(new PrintServer(), "PrinterName");
printDialog.PrintDocument(document, "PrintDocument");