I want to print FixedDocument with "Microsoft Print to PDF" and without showing up dialog to choose directory. I know that I can do this by passing to PrinterSettings: PrintFileName and PrintToFile with true:
PrinterSettings.PrinterName = "Microsoft Print to PDF";
PrinterSettings.PrintFileName = "C:\\Users";
PrinterSettings.PrintToFile = true;
There is way to pass printer name:
printDialog.PrintQueue = new PrintQueue(new PrintServer(), "printer name" );
but I do not know if it is possible or how to pass rest of parameters of printerSettings to PrintDialog.
To this moment I have used this method to print fixed document;
printDialog.PrintDocument(this.fixedDocument.DocumentPaginator, "Description");
I know that there is way with passing printerSettings to PrintDocument, but now I do not know how to pass these FixedDocument to PrintDocument.
I will add that I have array of bits with png, which is converted to BitmapImage, then putted to wpf UserControll Image and eventually to FixedDocument.Pages.