示例#1
0
        public void PrintElement(BasicElement element, PdfDocument pdf, PdfStream pdfStream)
        {
            var type = element.GetType();

            var adapter = new PdfStreamAdapter(pdfStream, defaultFont);

            if (type == typeof (Text))
            {
                adapter.PrintText((Text) element);
            }
            else if (type == typeof (Expression))
            {
                adapter.PrintExpression((Expression) element);
            }
            else if (type == typeof (Image))
            {
                adapter.PrintImage((Image) element);
            }
            else if (type == typeof (Rectangle))
            {
                adapter.PrintRectangle((Rectangle) element);
            }
            else if (type == typeof (Bookmark))
            {
                PrintBookmark((Bookmark) element, pdf);
            }
        }
示例#2
0
 public void AddElement(BasicElement e, int h)
 {
     e.H = h; Elements.Add(e);
 }