mer*_*bla 2 c# wpf printdialog flowdocument
只是想知道是否有办法在使用流文档的打印对话框上设置打印文档方向.
例如
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);
}
Run Code Online (Sandbox Code Playgroud)
小智 9
使用:
printDialog.PrintTicket.PageOrientation = System.Printing.PageOrientation.Landscape;
Run Code Online (Sandbox Code Playgroud)
您需要添加一个引用ReachFramework.dll和System.Printing.dll每个引用.