Represent the style for a FormatedText object.
상속: IStyle
예제 #1
0
// Phil Jollans 18-Feb-2008
// Additional construcor

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="document">The content object to which the formated text belongs to.</param>
        /// <param name="textstyle">An existing TextStyle object.</param>
        /// <param name="text">The Displaytext.</param>
        public FormatedText(IDocument document, TextStyle textstyle, string text)
        {
          this.Document				    = document;
          this.NewXmlNode ( textstyle.StyleName ) ;
          this.InitStandards();

          this.Text					    = text;
          this.Style					= textstyle ;
        }
        public TextReportGenerator ()
        {
            iTextSharp.text.Document.Compress = false;
            document = new TextDocument();
            document.New();

            BOLD_STYLE = new TextStyle (document, "boldML");
            BOLD_STYLE.TextProperties.Bold = "bold";
            BOLD_STYLE.TextProperties.FontName = "Times-Roman";
            document.Styles.Add (BOLD_STYLE);

            BOLD_UNDERLINE_STYLE = new TextStyle (document, "boldUndelineML");
            BOLD_UNDERLINE_STYLE.TextProperties.Bold = "bold";
            BOLD_UNDERLINE_STYLE.TextProperties.FontName = "Times-Roman";
            BOLD_UNDERLINE_STYLE.TextProperties.Underline = "solid";
            document.Styles.Add (BOLD_UNDERLINE_STYLE);

        }
예제 #3
0
		/// <summary>
		/// Creates the text style.
		/// </summary>
		/// <param name="styleNode">The style node.</param>
		private void CreateTextStyle(XmlNode styleNode)
		{
			TextStyle textStyle					= new TextStyle(this._document, styleNode.CloneNode(true));
			IPropertyCollection pCollection		= new IPropertyCollection();

			if (styleNode.HasChildNodes)
			{
				foreach(XmlNode node in styleNode.ChildNodes)
				{
					IProperty property			= this.GetProperty(textStyle, node.CloneNode(true));
					if (property != null)
						pCollection.Add(property);
				}
			}

			textStyle.Node.InnerXml				= "";

			foreach(IProperty property in pCollection)
				textStyle.PropertyCollection.Add(property);

			if (!this._common)
				this._document.Styles.Add(textStyle);
			else
				this._document.CommonStyles.Add(textStyle);
		}