需要现在服务器安装 abcpdf
先 using WebSupergoo.ABCpdf7;
string fileToSave = System.Web.HttpContext.Current.Server.MapPath("pdf保存路径");
Doc theDoc = new Doc();
XSettings.License = "XXX";//许可号 应该可以不填
theDoc.Font = theDoc.AddFont("宋体");
/*
theDoc.MediaBox.String = "0 0 590 840";
double w = theDoc.MediaBox.Width;
double h = theDoc.MediaBox.Height;
double l = theDoc.MediaBox.Left;
double b = theDoc.MediaBox.Bottom;
//要是横着打印就注解下面代码
// theDoc.Transform.Rotate(90, 1, b);
// theDoc.Transform.Translate(w, 0);
// rotate our rectangle
theDoc.Rect.Width = h;
theDoc.Rect.Height = w;
*/
// a