public void CreatePDFObjects() { FontDef fdNew; foreach (var itm in pdfCtrls) { if (itm.GetType().Equals(typeof(PDFLabel))) { PDFLabel tempPDFLbl = (PDFLabel)itm; try { fdNew = new FontDef(rpt, tempPDFLbl.FontNameType); fd = fdNew; } catch { } FontProp fp = new FontPropMM(fd, tempPDFLbl.FontSize / 10); page.Add(tempPDFLbl.X_Coord, tempPDFLbl.Y_Coord, new RepString(fp, tempPDFLbl.Text)); } else if (itm.GetType().Equals(typeof(PDFLine))) { PDFLine tempPDFLine = (PDFLine)itm; PenProp pp = new PenProp(rpt, tempPDFLine.thickness); page.Add(tempPDFLine.X_Coord, tempPDFLine.Y_Coord, new RepLine(pp, tempPDFLine.endX, tempPDFLine.endY)); } } }
public void PreviewItems() { mainVisualizer.GetMainPanel().Controls.Clear(); foreach (var itm in pdfCtrls) { if (itm != null) { if (itm.GetType().Equals(typeof(PDFLabel))) { mainVisualizer.GetMainPanel().Controls.Add(itm.winFormControl); } else if (itm.GetType().Equals(typeof(PDFLine))) { Pen pen = new Pen(Color.FromArgb(255, 0, 0, 0)); PDFLine tempLine = (PDFLine)itm; using (var e = mainVisualizer.GetMainPanel().CreateGraphics()) { e.DrawLine(pen, tempLine.X_Coord, tempLine.Y_Coord, tempLine.endX, tempLine.endY + tempLine.Y_Coord); } } } } }