本文整理汇总了Java中com.itextpdf.text.ListItem类的典型用法代码示例。如果您正苦于以下问题:Java ListItem类的具体用法?Java ListItem怎么用?Java ListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListItem类属于com.itextpdf.text包,在下文中一共展示了ListItem类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: process
import com.itextpdf.text.ListItem; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
List<Element> subs = context.collectChildren(level, node);
com.itextpdf.text.List orderedList = new com.itextpdf.text.List(com.itextpdf.text.List.ORDERED);
for (Element sub : subs) {
if (!orderedList.add(sub)) {
// wrap it
ListItem listItem = new ListItem();
listItem.add(sub);
orderedList.add(listItem);
}
}
KeyValues kvs = context.iTextContext().keyValues();
Float spacingBefore = kvs.<Float>getNullable(ORDERED_LIST_SPACING_BEFORE).or(5f);
Float spacingAfter = kvs.<Float>getNullable(ORDERED_LIST_SPACING_AFTER).or(5f);
Paragraph p = new Paragraph();
p.add(orderedList);
p.setSpacingBefore(spacingBefore);
p.setSpacingAfter(spacingAfter);
context.append(p);
}
开发者ID:Arnauld,项目名称:gutenberg,代码行数:27,代码来源:OrderedListNodeProcessor.java
示例2: createList
import com.itextpdf.text.ListItem; //导入依赖的package包/类
private static void createList(Section subCatPart) {
List list = new List(true, false, 10);
list.add(new ListItem("First point"));
list.add(new ListItem("Second point"));
list.add(new ListItem("Third point"));
subCatPart.add(list);
}
开发者ID:gonzapala,项目名称:CPI,代码行数:8,代码来源:generarPDF.java
示例3: buildComponent
import com.itextpdf.text.ListItem; //导入依赖的package包/类
@Override
public void buildComponent(SerialisationContext pSerialisationContext, PDFSerialiser pSerialiser, EvaluatedHtmlPresentationNode pEvalNode) {
ListItem lListItem = pSerialiser.getElementFactory().getListItem();
pSerialiser.startContainer(ElementContainerFactory.getContainer(lListItem));
processChildren(pSerialisationContext, pSerialiser, pEvalNode);
pSerialiser.endContainer();
pSerialiser.add(lListItem);
}
开发者ID:Fivium,项目名称:FOXopen,代码行数:11,代码来源:ListItemComponentBuilder.java
示例4: process
import com.itextpdf.text.ListItem; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
List<Element> subs = context.collectChildren(level, node);
com.itextpdf.text.List orderedList = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED);
orderedList.setListSymbol(context.bulletSymbol());
for (Element sub : subs) {
if (!orderedList.add(sub)) {
// wrap it
ListItem listItem = new ListItem();
listItem.add(sub);
orderedList.add(listItem);
}
}
KeyValues kvs = context.iTextContext().keyValues();
Float spacingBefore = kvs.<Float>getNullable(BULLET_LIST_SPACING_BEFORE).or(5f);
Float spacingAfter = kvs.<Float>getNullable(BULLET_LIST_SPACING_AFTER).or(5f);
Paragraph p = new Paragraph();
p.add(orderedList);
p.setSpacingBefore(spacingBefore);
p.setSpacingAfter(spacingAfter);
context.append(p);
}
开发者ID:Arnauld,项目名称:gutenberg,代码行数:28,代码来源:BulletListNodeProcessor.java
示例5: learnIText
import com.itextpdf.text.ListItem; //导入依赖的package包/类
public void learnIText() throws FileNotFoundException, DocumentException {
final Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream("/tmp/test.pdf"));
document.open();
Paragraph p = new Paragraph();
for(int i = 0; i < 100; i++) {
ZapfDingbatsList zapfdingbatslist = new ZapfDingbatsList(i);
zapfdingbatslist.add(new ListItem(i));
zapfdingbatslist.add(new ListItem("test2"));
p.add(zapfdingbatslist);
}
document.add(p);
/*
for(int i = 0; i < 100; i++) {
Paragraph p = new Paragraph();
p.add("This is a test 2");
// document.newPage();
document.add(p);
}
*/
document.close();
}
开发者ID:jesusc,项目名称:eclectic,代码行数:31,代码来源:Metamodel2Pdf.java
示例6: getListItem
import com.itextpdf.text.ListItem; //导入依赖的package包/类
/**
* Create a list item with the factory element attributes applied
* @return A list item with the element attributes applied
*/
public ListItem getListItem() {
ListItem lListItem = new ListItem();
return lListItem;
}
开发者ID:Fivium,项目名称:FOXopen,代码行数:9,代码来源:ElementFactory.java
注:本文中的com.itextpdf.text.ListItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论