private void SetPrintAreaText() { var im = printDocument.Image; PageSize = MapPrintDocument.GetPageSize(pageSetupDlg.PageSettings ?? printDocument.DefaultPageSettings); NumPages = printDocument.GetNumPages(PageSize); var pa = printDocument.PrintArea; printAreaLabel.Text = String.Format(R.PrintAreaFmt, pa.X, pa.Y, pa.Width, pa.Height, NumPages); pictureBox1.Invalidate(); }
private bool PageSetupSucceed(PrinterSettings ps, PageSettings pageSett) { printDocument.PrinterSettings = ps; printDocument.DefaultPageSettings = pageSett; PageSize = MapPrintDocument.GetPageSize(pageSett); if (OverlapSmallEnough(printDocument.Overlap)) { return(true); } float ovrl = (float)Math.Floor(Math.Min(PageSize.Width, PageSize.Height) * 25.4 / 100 / 4); // 1/4 of printDocument.Overlap = ovrl; overlap.Text = Float2Text(ovrl); MessageBox.Show(R.OverlapAdjusted, R.WarningTitle, MessageBoxButtons.OK, MessageBoxIcon.None); return(false); }