com.itextpdf.text.Phrase.addAll()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中com.itextpdf.text.Phrase.addAll()方法的一些代码示例,展示了Phrase.addAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Phrase.addAll()方法的具体详情如下:
包路径:com.itextpdf.text.Phrase
类名称:Phrase
方法名:addAll

Phrase.addAll介绍

[英]Adds a collection of Chunks to this Phrase.
[中]将Chunk的集合添加到此Phrase

代码示例

代码示例来源:origin: org.technbolts/gutenberg

p.addAll(head);

代码示例来源:origin: com.itextpdf/itextpdf

/**
 * Copy constructor for <CODE>Phrase</CODE>.
 * @param phrase the Phrase to copy
 */
public Phrase(final Phrase phrase) {
  super();
  this.addAll(phrase);
  setLeading(phrase.getLeading(), phrase.getMultipliedLeading());
  font = phrase.getFont();
  tabSettings = phrase.getTabSettings();
  setHyphenation(phrase.getHyphenation());
}

代码示例来源:origin: com.itextpdf/itextg

/**
 * Copy constructor for <CODE>Phrase</CODE>.
 * @param phrase the Phrase to copy
 */
public Phrase(final Phrase phrase) {
  super();
  this.addAll(phrase);
  setLeading(phrase.getLeading(), phrase.getMultipliedLeading());
  font = phrase.getFont();
  tabSettings = phrase.getTabSettings();
  setHyphenation(phrase.getHyphenation());
}

代码示例来源:origin: org.technbolts/gutenberg

@SuppressWarnings("unchecked")
@Override
public void process(int level, Node node, InvocationContext context) {
  TreeNavigation nav = context.treeNavigation();
  boolean isHeaderCell = nav.ancestorTreeMatches(TableCellNode.class, TableRowNode.class, TableHeaderNode.class);
  CellStyler cellStyler = context.peekCellStyler();
  context.pushFont(cellStyler.cellFont());
  List<Element> elements = context.collectChildren(level, node);
  context.popFont();
  Phrase phrase = new Phrase();
  phrase.addAll(elements);
  int colspan = ((TableCellNode) node).getColSpan();
  PdfPCell cell = isHeaderCell ? headerCell(phrase) : new PdfPCell(phrase);
  cell.setColspan(colspan);
  cellStyler.applyStyle(cell);
  context.append(cell);
}

代码示例来源:origin: org.technbolts/gutenberg

@Override
  public void process(int level, Node node, InvocationContext context) {
    ExpLinkNode linkNode = (ExpLinkNode) node;
    String url = context.variableResolver().resolve(linkNode.url);

    Font anchorFont = new FontCopier(context.peekFont())
        .style(Font.UNDERLINE)
        .color(Colors.DARK_RED)
        .get();

    context.pushFont(anchorFont);
    List<Element> subs = context.collectChildren(level, node);
    context.popFont();

    Phrase p = new Phrase();
    p.addAll(subs);

    Anchor anchor = new Anchor(p);
    anchor.setReference(url);
    context.append(anchor);
  }
}

相关文章