XTextStyle LeftMargin Property. The paragraph indent. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

 

Type Default Read Only Description
[C#] double

[Visual Basic]
Double
0 No The paragraph indent.

 

   

Notes
 

Allows you to apply a left margin to a block of text.

The left margin is a horizontal indent applied to every line of text. You can achieve the same effect by insetting the left of the current Rect but using this property can be more convenient.

If the value is positive the block is shifted to the right by the specified number of units. If the value is negative it is shifted to the left by the specified number of units.

 

   

Example
 

In the following example we add three blocks of text to a document. The first block uses the default left margin. The subsequent blocks use different left margin settings to indent the text.

[C#]
Doc theDoc = new Doc();
string theText = "Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani...";
theDoc.TextStyle.Size = 48;
theDoc.AddText(theText);
theDoc.Rect.Move(0, -250);
theDoc.TextStyle.LeftMargin = 100;
theDoc.AddText(theText);
theDoc.Rect.Move(0, -250);
theDoc.TextStyle.LeftMargin = 200;
theDoc.AddText(theText);
theDoc.Save(Server.MapPath("stylemargin.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theDoc As Doc = New Doc()
Dim theText As String = "Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani..."
theDoc.TextStyle.Size = 48
theDoc.AddText(theText)
theDoc.Rect.Move(0, -250)
theDoc.TextStyle.LeftMargin = 100
theDoc.AddText(theText)
theDoc.Rect.Move(0, -250)
theDoc.TextStyle.LeftMargin = 200
theDoc.AddText(theText)
theDoc.Save(Server.MapPath("stylemargin.pdf"))
theDoc.Clear()


stylelmargin.pdf