private void btnPrint_Click(object sender, RoutedEventArgs e) { PrintManager.Page = PrintPage.A3_Portrait; var doc = PrintManager.GetDocumentFrom(GetLayout()); var fixedDoc = PrintManager.FlowToFixed(doc); PrintPreviewWindow ppw = new PrintPreviewWindow { Owner = MainWindow.Current }; ppw.SetDocument(fixedDoc); ppw.ShowDialog(); }
public void PrintContent() { var list = GetPrintContent(); list.ForEach(x => x.HorizontalAlignment = System.Windows.HorizontalAlignment.Center); var part = NavigationManager.GetQueryString("part"); if (part == "summary") { PrintManager.Page = PrintPage.A3_Landscape; } else { PrintManager.Page = PrintPage.A3_Portrait; } var flow = PrintManager.GetDocumentFrom(list); var fixedDoc = PrintManager.FlowToFixed(flow); PrintPreviewWindow ppw = new PrintPreviewWindow { Owner = MainWindow.Current }; ppw.SetDocument(fixedDoc); ppw.ShowDialog(); }