private float TranslateLeft(Element el) { return el.Left + marginLeft; }
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; }
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(); }
private float CalculateUpperRightY(Element el) { float ury = TranslateTop(el); return ury; }
private float CalculateUpperRightX(Element el) { float urx = TranslateLeft(el) + el.Width; return urx; }
private float CalculateLowerLeftY(Element el) { float lly = TranslateTop(el) - el.Height; return lly; }
private float CalculateLowerLeftX(Element el) { float llx = TranslateLeft(el); return llx; }