Beispiel #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="attrs"></param>
        public BlockStyle(XmlAttributeCollection attrs) : base(attrs)
        {
            if (attrs != null)
            {
                if (PDFDraw.XmlHelper.GetAttributeValue(BorderColorAttributeConstant, attrs, null) != null)
                {
                    BorderColor = PDFDraw.XmlHelper.GetAttributeColor(BorderColorAttributeConstant, attrs, "White");
                }
                this.BorderWidth    = PDFDraw.XmlHelper.GetFloatAttributeValue(BorderWithAttributeConstant, attrs, 1.0F);
                this.FillBackground = PDFDraw.XmlHelper.GetAttributeBoolean(FillBackgroundAttributeConstant, attrs, false);

                this.Borders = PDFDrawItextSharpHelper.Border(Moon.PDFDraw.XmlHelper.GetStringArray(BorderAttributeConstant, attrs));
                if (this.Borders != iTextSharp.text.Rectangle.NO_BORDER)
                {
                    if (BorderWidth <= 0)
                    {
                        BorderWidth = 1.0F;                                     //defaults
                    }
                    if (BorderColor == null)
                    {
                        BorderColor = Color.Black;                                        //defaults.
                    }
                }
            }
        }