Esempio n. 1
0
        /// <summary>
        /// Clones the structure of the RichTextField, including all properties
        /// </summary>
        /// <returns><see cref="Com.Delta.Print.Engine.TextField">daReport.TextField</see></returns>
        public override object Clone()
        {
            RichTextField tmp = new RichTextField(this.X, this.Y, this.Width, this.Height, this.section);

            tmp.Layout               = this.Layout;
            tmp.content              = this.content;
            tmp.borderWidth          = this.borderWidth;
            tmp.borderColor          = this.borderColor;
            tmp.backgroundColor      = this.backgroundColor;
            tmp.font                 = this.font;
            tmp.foregroundColor      = this.foregroundColor;
            tmp.OverflowTextHandling = this.OverflowTextHandling;


            return(tmp);
        }
Esempio n. 2
0
        private void ProcessRichTextField(PdfPage page, Com.Delta.Print.Engine.RichTextField richTextField)
        {
            try
            {
                PdfArea area = new PdfArea(pdfDocument, Convert(richTextField.Bounds.X), Convert(richTextField.Bounds.Y), Convert(richTextField.Bounds.Width), Convert(richTextField.Bounds.Height));

                if ((richTextField.BorderWidth > 0 && richTextField.BorderColor != Color.Transparent) || richTextField.BackgroundColor != Color.Transparent)
                {
                    PdfRectangle border = new PdfRectangle(pdfDocument, area, richTextField.BorderColor, Convert(richTextField.BorderWidth), richTextField.BackgroundColor);
                    page.Add(border);
                }

                PdfRichTextBox p = new PdfRichTextBox(pdfDocument, (int)Convert(richTextField.Bounds.X + richTextField.Padding), (int)Convert(richTextField.Bounds.Y + richTextField.Padding), (int)Convert(richTextField.Bounds.Width - 2 * richTextField.Padding), (int)Convert(richTextField.Bounds.Height - 2 * richTextField.Padding));
                p.SetLines(new ArrayList(richTextField.lines));

                page.Add(p);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }