Ejemplo n.º 1
0
        private void RenderFooter(XGraphics graphics, int page)
        {
            FormattedHeaderFooter formattedFooter = this.formattedDocument.GetFormattedFooter(page);

            if (formattedFooter == null)
            {
                return;
            }

            Rectangle footerArea = this.formattedDocument.GetFooterArea(page);

            RenderInfo[] renderInfos = formattedFooter.GetRenderInfos();
            XUnit        topY        = footerArea.Y + footerArea.Height - RenderInfo.GetTotalHeight(renderInfos);

            FieldInfos fieldInfos = this.formattedDocument.GetFieldInfos(page);

            foreach (RenderInfo renderInfo in renderInfos)
            {
                Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos);
                XUnit    savedY   = renderer.RenderInfo.LayoutInfo.ContentArea.Y;
                renderer.RenderInfo.LayoutInfo.ContentArea.Y = topY;
                renderer.Render();
                renderer.RenderInfo.LayoutInfo.ContentArea.Y = savedY;
            }
        }
Ejemplo n.º 2
0
 void FormatFooter(HeaderFooterPosition hfp, HeaderFooter footer)
 {
     if (footer != null && !this.formattedFooters.ContainsKey(hfp))
     {
         FormattedHeaderFooter formattedHeaderFooter = new FormattedHeaderFooter(footer, this.documentRenderer, this.currentFieldInfos);
         formattedHeaderFooter.ContentRect = GetFooterArea(this.currentSection, this.currentPage);
         formattedHeaderFooter.Format(gfx);
         this.formattedFooters.Add(hfp, formattedHeaderFooter);
     }
 }
Ejemplo n.º 3
0
        private void RenderHeader(XGraphics graphics, int page)
        {
            FormattedHeaderFooter formattedHeader = this.formattedDocument.GetFormattedHeader(page);

            if (formattedHeader == null)
            {
                return;
            }

            Rectangle headerArea = this.formattedDocument.GetHeaderArea(page);

            RenderInfo[] renderInfos = formattedHeader.GetRenderInfos();
            FieldInfos   fieldInfos  = this.formattedDocument.GetFieldInfos(page);

            foreach (RenderInfo renderInfo in renderInfos)
            {
                Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos);
                renderer.Render();
            }
        }