Hello Aspose,
if a line containing tabstops is breaking at line end the following #$TAB are not replaced anymore.
grafik.png (16.6 KB)
Further the set font is ignored, which I can observe if I set it in the first line (TextFragment header).
If I reduce the line length, the TabStops seems to work, but the text is shifted left which is not the indented behavior of a TabStop. The next matching TabStop behind the former Segment should be choosen.
grafik.png (5.8 KB)
Is there a workaround?
Regards
Gerd
private static string TabStopTest(Page page)
{
TabStops tss = new Aspose.Pdf.Text.TabStops();
var ts = tss.Add(27 );
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts = tss.Add(54 );
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts = tss.Add(81 );
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(108);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(135);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(162);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(189);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(216);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(243);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(270);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(297);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(324);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(351);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(378);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(405);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
ts= tss.Add(432);
ts.AlignmentType = TabAlignmentType.Right;
ts.LeaderType = TabLeaderType.None;
TextFragment header = new TextFragment("This is a example of forming table with TAB stops");
TextFragment text = new TextFragment(tss);
text.Segments.Add(new TextSegment("the#$TABpseudo table#$TABwith monospace text:#$TAB 3the#$TABtable#$TAB#$TABwith text:#$TAB#$TAB#$TAB 5#$TABpseudo table#$TABwith monospace text:#$TAB 3#$TAB#$TAB#$TABtable#$TABwith text:#$TAB#$TAB 6\"") { TextState = { Font = FontRepository.FindFont("Courier New")}});
page.Paragraphs.Add(header);
page.Paragraphs.Add(text);
return Path.Combine(myDataDir, "TabStopTest.pdf");
}
public static void Main()
{
Document doc = new Document();
Page page = doc.Pages.Add();
var file = TabStopTest(page);
if (File.Exists(file)) { File.Delete(file); }
doc.Save(file);
Process.Start(file);
}