任何人都知道TabStop如何在iText 5.5.0中运行 [英] Anyone have any idea how TabStop works in iText 5.5.0

查看:274
本文介绍了任何人都知道TabStop如何在iText 5.5.0中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然在尝试学习iText,并且有一些概念。但是,我无法弄清楚TabStop是什么或如何使用它。我特别的问题是我想用一堆破折号填充所有段落的末尾。我相信这被称为TabStop,我在itext jar中看到了类,但我不知道如何使用它。我一定是在谷歌上搜索错误的东西,但我什么也没想出来。 iText in Action书中似乎甚至不知道这个类的存在,所以任何帮助都非常感谢!

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 jar but I have no clue on how to use it. I must be searching the wrong thing on google, but I've come up with nothing. The iText in Action book also doesnt seem to even know of the existance of this class so any help is much appreciated!

推荐答案

请看一下 ChunkTest 类。它包含制表位功能的几个用例。例如:

Please take a look at the ChunkTest class in iText's test suite. It contains several use cases of the tab stop functionality. For instance:

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

引入 TabStop 功能 iText in Action 书籍之后。它们将被记录在一本新书中。

The TabStop functionality was introduced after the iText in Action books were written. They'll be documented in one of the new books.

另一个例子,请参阅 http://developers.itextpdf.com/examples/itext-building-blocks/tabbing-examples

这篇关于任何人都知道TabStop如何在iText 5.5.0中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆