private void BTN_Generate_PDF_Click(object sender, EventArgs e) { PdfBuilder pdf_builder = new PdfBuilder(); pdf_builder.HeaderLeft = TB_UpperLeft.Text; pdf_builder.HeaderRight = TB_UpperRight.Text; pdf_builder.FooterLeft = TB_DownLeft.Text; pdf_builder.Title = TB_DocumentTitle.Text; pdf_builder.Start(); foreach (EquationGenerator gen in Generators) { pdf_builder.AddEquations(gen); } DateTime t = DateTime.Now; string fname = string.Empty; fname += "coucou"; fname += "---"; fname += string.Format("{0:D4}-{1:D2}-{2:D2}", t.Year, t.Month, t.Day); fname += "---"; fname += string.Format("{0:D2}-{1:D2}-{2:D2}", t.Hour, t.Minute, t.Second); fname += ".pdf"; pdf_builder.Save(fname); }
public static void TestThem() { List <EquationGenerator> generators = new List <EquationGenerator>(); generators.Add(new EquationGenerator(Range.DU_10_19, OperationEnum.Addition, Range.U_01_09, Range.DU_10_19)); generators.Add(new EquationGenerator(Range.U_01_09, OperationEnum.Addition, Range.DU_10_19, Range.DU_10_19)); generators.Add(new EquationGenerator(Range.DU_10_19, OperationEnum.Addition, Range.U_01_09, Range.DU_20_29)); generators.Add(new EquationGenerator(Range.DU_10_19, OperationEnum.Substraction, Range.U_01_09, Range.U_01_09)); generators.Add(new EquationGenerator(Range.DU_10_19, OperationEnum.Substraction, Range.U_01_09, Range.DU_10_19)); foreach (EquationGenerator g in generators) { g.Dump(); } PdfBuilder pdf_builder = new PdfBuilder(); foreach (EquationGenerator g in generators) { foreach (ElipsisPositionEnum e in Enum.GetValues(typeof(ElipsisPositionEnum))) { g.ElipsisPosition = e; pdf_builder.AddEquations(g); } } pdf_builder.Save("coucou.pdf"); }