AODL.ExternalExporter.PDF.Document.ContentConverter.SimpleTextConverter.ConvertWhiteSpaces C# (CSharp) Method

ConvertWhiteSpaces() public static method

Converts the white spaces.
public static ConvertWhiteSpaces ( AODL whiteSpace, iTextSharp font ) : iTextSharp.text.Phrase
whiteSpace AODL The white space.
font iTextSharp
return iTextSharp.text.Phrase
		public static iTextSharp.text.Phrase ConvertWhiteSpaces(AODL.Document.Content.Text.TextControl.WhiteSpace whiteSpace, iTextSharp.text.Font font)
		{
			try
			{
				string simulatedWhitespaces = "";
				if (whiteSpace.Count != null)
				{
					for(int i=0; i < Int32.Parse(whiteSpace.Count); i++)
					{
						simulatedWhitespaces += " ";
					}
				}
				return new iTextSharp.text.Phrase(simulatedWhitespaces, font);
			}
			catch(Exception)
			{
				throw;
			}
		}
	}

Usage Example

Example #1
0
 /// <summary>
 /// Gets the text contents.
 /// </summary>
 /// <param name="textCollection">The text collection.</param>
 /// <returns>The content. ArrayList of chunks and phrases.</returns>
 public static ICollection GetTextContents(ITextCollection textCollection, iTextSharp.text.Font font)
 {
     try
     {
         ArrayList contents = new ArrayList();
         foreach (object obj in textCollection)
         {
             if (obj is AODL.Document.Content.Text.FormatedText)
             {
                 contents.Add(FormatedTextConverter.Convert(
                                  obj as AODL.Document.Content.Text.FormatedText));
             }
             else if (obj is AODL.Document.Content.Text.SimpleText)
             {
                 contents.Add(SimpleTextConverter.Convert(
                                  obj as AODL.Document.Content.Text.SimpleText, font));
             }
             else if (obj is AODL.Document.Content.Text.TextControl.TabStop)
             {
                 contents.Add(SimpleTextConverter.ConvertTabs(
                                  obj as AODL.Document.Content.Text.TextControl.TabStop, font));
             }
             else if (obj is AODL.Document.Content.Text.TextControl.WhiteSpace)
             {
                 contents.Add(SimpleTextConverter.ConvertWhiteSpaces(
                                  obj as AODL.Document.Content.Text.TextControl.WhiteSpace, font));
             }
         }
         return(contents);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
All Usage Examples Of AODL.ExternalExporter.PDF.Document.ContentConverter.SimpleTextConverter::ConvertWhiteSpaces