只是想知道是否有一种方法可以在使用流程文档的打印对话框上设置打印文档的方向。
。
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);
}
使用说明:
printDialog.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
您需要分别添加对ReachFramework.dll
和System.Printing.dll
的引用