In WPF C#, how can I set printer page settings to landscape. I am trying to print a flowdocument. I have tried different things but nothing seems to be working.
Here is my code.
- IDocumentPaginatorSource dps = this.MyFlowDoc;
- // pd.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
- // pd.PrintTicket.PageMediaSize = new System.Printing.PageMediaSize(System.Printing.PageMediaSizeName.ISOA4Rotated);
- pd.PrintQueue.CurrentJobSettings.CurrentPrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
- pd.PrintDocument(dps.DocumentPaginator, "MyInvoice");
Ravishankar VelladuraiPosted Aug 15, 2017, 12:48 PM