//获得相关点坐标、长度、宽度 int x = e.PageSettings.Margins.Left; int y = e.PageSettings.Margins.Right; int width =e.PageSettings.PaperSize.Width-e.PageSettings.Margins.Left-e.PageSettings.Margins.Right; int height =e.PageSettings.PaperSize.Height-e.PageSettings.Margins.Top-e.PageSettings.Margins.Bottom;
//设置字体 Font font=new Font("宋体",15);
//这个方法后面讲
g.MeasureString(text.Substring(sub), font, new SizeF(width,height-10), new StringFormat(), out charnum, out line);
//打印string g.DrawString(text.Substring(sub), font, Brushes.Black, newRectangleF(x, y, width, height), newStringFormat());