In this example we add three blocks of text to a document. The
first block uses the default spacing. The second block uses a
positive value to stretch out the text. The last block uses a
negative value to condense the text.
using var doc = new Doc();
string text = "This is an example of word spacing.";
doc.TextStyle.Size = 72;
doc.AddText(text);
doc.Rect.Move(0, -300);
doc.TextStyle.WordSpacing = 20;
doc.AddText(text);
doc.Rect.Move(0, -300);
doc.TextStyle.WordSpacing = -20;
doc.AddText(text);
doc.Save(Server.MapPath("stylewspace.pdf"));
Using doc As New Doc()
Dim theText As String = "This is an example of word spacing."
doc.TextStyle.Size = 72
doc.AddText(theText)
doc.Rect.Move(0, -300)
doc.TextStyle.WordSpacing = 20
doc.AddText(theText)
doc.Rect.Move(0, -300)
doc.TextStyle.WordSpacing = -20
doc.AddText(theText)
doc.Save(Server.MapPath("stylewspace.pdf"))
End Using