/// <summary> /// Prints the document using the current print and page settings. /// </summary> public void Print() { PrintDocument doc = this.GetCommonPrintDocument(); PrintManager pm = new PrintManager(doc, this.host, this, false); pm.Print(); }
// printing methods /// <summary> /// Prints the document using the current print and page settings. /// </summary> public void Print() { PrintDocument doc = new PrintDocument(); doc.DocumentName = this.DocumentTitle; doc.DefaultPageSettings = PageSettings; doc.OriginAtMargins = true; PrintManager pm = new PrintManager(doc, this, false); pm.Print(); }
/// <summary> /// Displays a Print Preview dialog box. /// </summary> public void ShowPrintPreviewDialog() { // TODO: find out why it apparently only shows the first page on the preview... using (PrintPreviewDialog printDlg = new PrintPreviewDialog()) { PrintDocument doc = GetCommonPrintDocument(); printDlg.Document = doc; PrintManager pm = new PrintManager(doc, this.host, this, true); pm.Print(); printDlg.ShowDialog(); } }
/// <summary> /// Displays a Print dialog box. /// </summary> public void ShowPrintDialog() { PrintDialog printDlg = new PrintDialog(); PrintDocument doc = this.GetCommonPrintDocument(); printDlg.Document = doc; if (printDlg.ShowDialog() == DialogResult.OK) { PrintManager pm = new PrintManager(doc, this.host, this, false); pm.Print(); } }
/// <summary> /// Displays a Print Preview dialog box. /// </summary> public void ShowPrintPreviewDialog() { // TODO: find out why it apparently only shows the first page on the preview... PrintPreviewDialog printDlg = new PrintPreviewDialog(); PrintDocument doc = new PrintDocument(); doc.DocumentName = this.DocumentTitle; doc.DefaultPageSettings = PageSettings; doc.OriginAtMargins = true; printDlg.Document = doc; PrintManager pm = new PrintManager(doc, this, true); pm.Print(); printDlg.ShowDialog(); }
/// <summary> /// Displays a Print dialog box. /// </summary> public void ShowPrintDialog() { PrintDialog printDlg = new PrintDialog(); PrintDocument doc = new PrintDocument(); doc.DocumentName = this.DocumentTitle; doc.DefaultPageSettings.Margins = new Margins(500, 100, 100, 100); doc.OriginAtMargins = true; printDlg.Document = doc; if (printDlg.ShowDialog() == DialogResult.OK) { PrintManager pm = new PrintManager(doc, this); pm.Print(); } }
/// <summary> /// Displays a Print Preview dialog box. /// </summary> public void ShowPrintPreviewDialog() { // TODO: find out why it apparently only shows the first page on the preview... PrintPreviewDialog printDlg = new PrintPreviewDialog(); PrintDocument doc = this.GetCommonPrintDocument(); printDlg.Document = doc; PrintManager pm = new PrintManager(doc, this.host, this, true); pm.Print(); printDlg.ShowDialog(); }