/// <summary> /// Tests texts and blanks. /// </summary> public static void TextAndBlanks(string pdfOutputFile) { Document document = new Document(); Section section = document.AddSection(); Paragraph par = section.AddParagraph("Dies"); for (int idx = 0; idx <= 40; ++idx) { par.AddCharacter(SymbolName.Blank); par.AddText(idx.ToString()); par.AddCharacter(SymbolName.Blank); par.AddText((idx + 1).ToString()); par.AddCharacter(SymbolName.Blank); par.AddText((idx + 2).ToString()); } PdfDocumentRenderer renderer = new PdfDocumentRenderer(); renderer.Document = document; renderer.RenderDocument(); renderer.PdfDocument.Save(pdfOutputFile); }
// [UnitTestFunction] public static void TestSpecialCharacters() { Document doc = new Document(); Section sec = doc.Sections.AddSection(); Paragraph par = sec.AddParagraph(); par.AddCharacter('\x93'); par.AddCharacter(SymbolName.Blank); par.AddCharacter(SymbolName.Bullet); par.AddCharacter(SymbolName.Copyright); par.AddCharacter(SymbolName.Em); par.AddCharacter(SymbolName.Em4); par.AddCharacter(SymbolName.EmDash); par.AddCharacter(SymbolName.En); par.AddCharacter(SymbolName.EnDash); par.AddCharacter(SymbolName.Euro); par.AddCharacter(SymbolName.HardBlank); par.AddCharacter(SymbolName.LineBreak); par.AddCharacter(SymbolName.Not); par.AddCharacter(SymbolName.ParaBreak); par.AddCharacter(SymbolName.RegisteredTrademark); par.AddCharacter(SymbolName.Tab); par.AddCharacter(SymbolName.Trademark); DocumentRenderer docRndrr = new DocumentRenderer(); docRndrr.Render(doc, "RtfSpecialChars.txt", null); File.Copy("RtfSpecialChars.txt", "RtfSpecialChars.rtf", true); System.Diagnostics.Process.Start("RtfSpecialChars.txt"); }