Legacy notice!

iText 5 is the previous major version of iText’s leading PDF SDK. iText 5 is EOL, and is no longer developed, although we still provide support and security fixes. Switch your project to iText 8, our latest version which supports the latest PDF standards and technologies.
Check related iText 8 content!

I'm still trying to learn iText and have a few of the concepts down. However I can't figure out what TabStop is or how to use it. My particular problem is that I want to fill the end of all paragraphs with a bunch of dashes. I believe this is called a TabStop and I see the class in the iText API but I have no clue on how to use it.

Posted on StackOverflow on Mar 26, 2014 by Jesus Mireles

This is a short example that uses the TabStop class:

java.util.List tabStopsList = new ArrayList();
tabStopsList.add(new TabStop(100, new DottedLineSeparator()));
tabStopsList.add(new TabStop(200, new LineSeparator(),
tabStopsList.add(new TabStop(300, new DottedLineSeparator(),
p = new Paragraph(new Chunk("Hello world", f));
p.setTabSettings(new TabSettings(tabStopsList, 50));
addTabs(p, f, 0, "la|la");

Hope this helps.

Click this link if you want to see how to answer this question in iText 7.