为什么打印之前要多余的去测量字体大小?
Font titleFont = new Font("宋体", 12); SizeF titleSize = e.Graphics.MeasureString("计划单", titleFont);//测量字体大小 X = (e.PageBounds.Width - titleSize.Width) / 2; e.Graphics.DrawString("计划单", titleFont, Brushes.Black, X, Y);//画标题 Y += titleSize.Height + 15; X = e.PageBounds.Width * 0.05f; titleFont.Dispose();