Пример #1
0
        /// <summary>
        /// Renderiza um rótulo de texto no Bloco.
        /// </summary>
        /// <param name="p_object">Objeto a ser renderizado.</param>
        /// <param name="p_posx">Posição X.</param>
        /// <param name="p_posy">Posição Y.</param>
        /// <param name="p_rightmargin">Margem direita.</param>
        /// <param name="p_font">Fonte.</param>
        /// <param name="p_pdf">Objeto PDF.</param>
        /// <param name="p_page">Página onde será renderizado.</param>
        private void RenderText(Spartacus.Reporting.Object p_object, double p_posx, double p_posy, double p_rightmargin, Spartacus.Reporting.Font p_font, PDFjet.NET.PDF p_pdf, PDFjet.NET.Page p_page)
        {
            PDFjet.NET.TextLine v_text;

            if (p_object.v_pdfobject == null)
            {
                v_text = new PDFjet.NET.TextLine(p_font.GetFont(p_pdf));

                v_text.SetText(System.Net.WebUtility.HtmlDecode(p_object.v_value));
                switch (p_object.v_align)
                {
                    case Spartacus.Reporting.FieldAlignment.LEFT:
                        v_text.SetPosition(p_posx + p_object.v_posx, p_posy + p_object.v_posy);
                        break;
                    case Spartacus.Reporting.FieldAlignment.RIGHT:
                        v_text.SetPosition(p_page.GetWidth() - p_rightmargin - v_text.GetWidth(), p_posy + p_object.v_posy);
                        break;
                    case Spartacus.Reporting.FieldAlignment.CENTER:
                        v_text.SetPosition(p_posx + ((p_page.GetWidth() - p_rightmargin - p_posx) / 2) - (v_text.GetWidth() / 2), p_posy + p_object.v_posy);
                        break;
                    default:
                        break;
                }

                v_text.DrawOn(p_page);

                p_object.v_pdfobject = v_text;
            }
            else
                ((PDFjet.NET.TextLine) p_object.v_pdfobject).DrawOn(p_page);
        }