本文整理汇总了Java中com.itextpdf.text.Paragraph.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java Paragraph.addAll方法的具体用法?Java Paragraph.addAll怎么用?Java Paragraph.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.addAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
HeaderNode hNode = (HeaderNode) node;
int hLevel = hNode.getLevel();
Sections sections = context.iTextContext().sections();
Font font = sections.sectionTitlePrimaryFont(hLevel);
context.pushFont(font);
List<Element> subs = context.collectChildren(level, node);
context.popFont();
Paragraph p = new Paragraph();
p.setFont(font);
p.addAll(subs);
Element element = sections.newSection(p, hLevel);
context.append(element);
}
示例2: end
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public List<Element> end(WorkerContext ctx, Tag tag, List<Element> currentContent) {
List<Element> elements = super.end(ctx, tag, currentContent);
Paragraph paragraph = createParagraph();
paragraph.addAll(elements);
String content = paragraph.getContent();
if (level == 1) {
final Chapter chapter = configuration.createTitledChapter(content);
return new ArrayList<Element>(1) {{
add(chapter);
}};
}
return elements;
}
示例3: process
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
Font font = context.peekFont();
BaseColor color = styles.getColor(Styles.BLOCKQUOTE_COLOR).or(BaseColor.LIGHT_GRAY);
context.pushFont(new FontCopier(font).italic().color(color).get());
List<Element> subs = context.collectChildren(level, node);
context.popFont();
Paragraph p = new Paragraph();
p.addAll(subs);
PdfPCell cell = new PdfPCell();
cell.addElement(p);
cell.setBorder(Rectangle.NO_BORDER);
PdfPCell cellSymbol = new PdfPCell(
new Phrase(context.symbol("quote-left", 24, color))
);
cellSymbol.setVerticalAlignment(Element.ALIGN_TOP);
cellSymbol.setBorder(Rectangle.NO_BORDER);
cellSymbol.setBorderWidthRight(1.0f);
cellSymbol.setBorderColorRight(color);
cellSymbol.setPaddingTop(0f);
cellSymbol.setPaddingBottom(5f);
cellSymbol.setPaddingLeft(10f);
cellSymbol.setPaddingRight(0f);
PdfPTable table = new PdfPTable(new float[]{1, 10});
table.addCell(cellSymbol);
table.addCell(cell);
table.setSpacingBefore(20f);
table.setSpacingAfter(20f);
context.append(table);
}
示例4: process
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
Attributes attrs = lookupAttributes(context);
List<Element> subs = context.collectChildren(level, node);
Paragraph p = new Paragraph();
p.addAll(subs);
PdfPCell cell = new PdfPCell();
cell.addElement(p);
cell.setBorderColor(BaseColor.LIGHT_GRAY);
cell.setBorder(Rectangle.TOP + Rectangle.BOTTOM);
cell.setPaddingTop(10f);
cell.setPaddingBottom(10f);
Styles styles = context.iTextContext().styles();
BaseColor symbolColor = symbolColor(attrs, styles);
PdfPCell cellSymbol = new PdfPCell(
new Phrase(context.symbol(symbol(attrs), 24, symbolColor))
);
cellSymbol.setVerticalAlignment(Element.ALIGN_TOP);
cellSymbol.setBorderColor(BaseColor.LIGHT_GRAY);
cellSymbol.setBorder(Rectangle.TOP + Rectangle.BOTTOM);
cellSymbol.setPaddingTop(10f);
cellSymbol.setPaddingBottom(10f);
cellSymbol.setPaddingLeft(0f);
cellSymbol.setPaddingRight(10f);
PdfPTable table = new PdfPTable(new float[]{1, 10});
table.addCell(cellSymbol);
table.addCell(cell);
table.setSpacingBefore(20f);
table.setSpacingAfter(20f);
ITextUtils.applyAttributes(table, attrs);
context.append(table);
}