Interface for a text element.
示例#1
0
 private float TranslateLeft(Element el)
 {
     return el.Left + marginLeft;
 }
示例#2
0
 private float TranslateTop(Element el)
 {
     var top = PageHeight - el.Top;
     if (el.ReportSection == el.ReportSection.Report.Body)
         top -= el.ReportSection.Report.Header.Height;
     /*else if (el.ReportSection == el.ReportSection.Report.Footer)
         top -= el.ReportSection.Report.Header.Height + el.ReportSection.Report.Body.Height;*/
     if (el.ReportSection == el.ReportSection.Report.Footer)
         top = el.ReportSection.Report.Footer.Height - el.Top;
     return top;
 }
示例#3
0
 private void RenderElement(Element el, PdfContentByte dc = null)
 {
     if (dc == null)
         dc = this.dc;
     dc.SaveState();
     if (el != el.ReportSection.Elements[0] && el.Top == 0)
     {
         //el.Top = el.ReportSection.Height;
         var bottom = el.ReportSection.Elements
             .OrderByDescending(o => o.Height)
             .ThenByDescending(o => o.Top)
             .FirstOrDefault();
         if (bottom != null)
             el.Top = bottom.Top + bottom.Height;
     }
     if (el is TextElement)
     {
         RenderTextElement(el as TextElement, dc);
     }
     else if (el is TableElement)
     {
         RenderTableElement(el as TableElement, dc);
     }
     else if (el is ImageElement)
     {
         RenderImageElement(el as ImageElement, dc);
     }
     dc.RestoreState();
 }
示例#4
0
 private float CalculateUpperRightY(Element el)
 {
     float ury = TranslateTop(el);
     return ury;
 }
示例#5
0
 private float CalculateUpperRightX(Element el)
 {
     float urx = TranslateLeft(el) + el.Width;
     return urx;
 }
示例#6
0
 private float CalculateLowerLeftY(Element el)
 {
     float lly = TranslateTop(el) - el.Height;
     return lly;
 }
示例#7
0
 private float CalculateLowerLeftX(Element el)
 {
     float llx = TranslateLeft(el);
     return llx;
 }