Reputation: 547
Just wondering if there is a way to set the print document orientation on a Print Dialog that is using a flow document.
e.g.
var document = userControl.Content as FlowDocument;
var printDialog = new PrintDialog();
if (printDialog.ShowDialog() == true)
{
var paginator = ((IDocumentPaginatorSource) document).DocumentPaginator;
paginator.PageSize = new Size(userControl.Width, userControl.Height);
//Set Orientation Landscape .....
printDialog.PrintDocument(paginator, PrintDescription);
}
Upvotes: 2
Views: 6618
Reputation: 101
Use:
printDialog.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
You need to add a reference to ReachFramework.dll
and System.Printing.dll
each.
Upvotes: 10