1
Answer

WPF: Set Printing Orientation to Landscape?

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.
  1. IDocumentPaginatorSource dps = this.MyFlowDoc;  
  2. // pd.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;  
  3. // pd.PrintTicket.PageMediaSize = new System.Printing.PageMediaSize(System.Printing.PageMediaSizeName.ISOA4Rotated);  
  4.   
  5. pd.PrintQueue.CurrentJobSettings.CurrentPrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;  
  6. pd.PrintDocument(dps.DocumentPaginator, "MyInvoice");  
Answers (1)