A Tab Stop is a stop point for tabbing. In word processing, each line contains a number of tab stops placed at regular intervals (for example, every half inch). They can be changed, however, as most word processors allow you to set tab stops wherever you want. When you press the Tab key, the cursor or insertion point jumps to the next tab stop, which itself is invisible. Although tab stops do not exist in the text file, the word processor keeps track of them so that it can react correctly to the Tab key.
|
Figure: Tab Stops in a word processor |
Aspose.Pdf allows developers to use custom tab stops in PDF documents. Text.TabStops property is used to set custom TAB stops in the Text Paragraph .
Aspose.Pdf also offers some pre-defined tab leader types as an enumeration named, TabLeaderType whose pre-defined values and their descriptions are given below:
Tab Leader Type |
Description |
None |
No tab leader |
Solid |
Solid tab leader |
Dash |
Dash tab leader |
Dot |
Dot tab leader |
Here is an example about how to set custom TAB stops.
Code Snippet
[C#]
//Create a text object
Text t1 = new Text("This #$TAB is a example for custom TAB stop positions.");
//Assign an instance of TabStops to the TabStops property of text object
t1.TabStops = new TabStops();
//Call Add method of TabStops and pass a specified position as argument
t1.TabStops.Add(150);
//Call Add method with specified position and tab leader type as Dot
t1.TabStops.Add(350,TabLeaderType.Dot);
[VB.NET]
'Create a text object
Dim t1 As Aspose.Pdf.Text = New Aspose.Pdf.Text("This #$TAB is a example for custom TAB stop positions.")
'Call Add method of TabStops and pass a specified position as argument
t1.TabStops = New TabStops t1.TabStops.Add(150)
'Initialize an instance of TabStops and call Add method with specified position and tab leader type as Dot
t1.TabStops.Add(350, TabLeaderType.Dot)
[XML]
<Text>
<TabStops>
<TabStop Position="150" />
<TabStop Position="350" LeaderType="Dot" />
</TabStops>
<Segment>
This is a example for custom TAB stop positions.
</Segment>
</Text>