只是想知道是否有办法在使用流文档的打印对话框上设置打印文档方向。
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);
}
答案 0 :(得分:9)
使用:
printDialog.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
您需要添加对ReachFramework.dll
和System.Printing.dll
的引用。