/// <summary> /// 测试预览 /// </summary> /// <param name="pStr"></param> public static void TestPreview(string pStr) { TextPrinter textPrinter = new TextPrinter(); textPrinter.Context = pStr; textPrinter.Font = new Font("宋体", 6, FontStyle.Regular, GraphicsUnit.Pixel); textPrinter.Title = "打印测试页"; textPrinter.TitleFont = new Font("宋体", 8, FontStyle.Bold, GraphicsUnit.Pixel); textPrinter.TitleType = TitleType.AllPage; textPrinter.FooterType = FooterType.OnlyPageNum; textPrinter.FooterFormat = "Page {0}"; //textPrinter.PrintSetting(); //textPrinter.PageSetting(); textPrinter.Preview(); //textPrinter.Print(); }
private void button1_Click(object sender, EventArgs e) { textPrinter = new TextPrinter(); textPrinter.Context = skExpenseContext; textPrinter.Font = new Font("宋体", 12, FontStyle.Regular, GraphicsUnit.Pixel); textPrinter.Title = "承康小儿推拿总店"; textPrinter.TitleFont = new Font("宋体", 14, FontStyle.Bold, GraphicsUnit.Pixel); textPrinter.TitleType = TitleType.OnlyFirstPage; textPrinter.FooterType = FooterType.None; //textPrinter.FooterFormat = "Page {0}"; //txtPrinter = new TextPrinter(); //txtPrinter.Title = "承康小儿推拿总店"; //txtPrinter.Context = skExpenseContext; //txtPrinter.FooterFormat = string.Format(txtPrinter.FooterFormat, 1); //txtPrinter.RowPadding = 10; }
private void button5_Click(object sender, EventArgs e) { TextPrinter.TestPreview(skExpenseContext); }