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

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

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

Paragraph.addAll介绍

暂无

代码示例

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

@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);
  }
}

代码示例来源:origin: org.technbolts.tzatziki/tzatziki-pdf

if (!Strings.isNullOrEmpty(methodEntry.comment())) {
  List<Element> subs = context.emitButCollectElements(Markdown.from(methodEntry.comment()));
  p.addAll(subs);
  p.add(Chunk.NEWLINE);

代码示例来源:origin: org.technbolts.tzatziki/tzatziki-pdf

public static Paragraph formatStep(StepExec step, boolean includeKeyword, Styles styles, ITextContext emitterContext) {
  Font stepKeywordFont = styles.getFontOrDefault(STEP_KEYWORD_FONT);
  Font stepPhraseFont = styles.getFontOrDefault(STEP_PHRASE_FONT);
  Font stepParamFont = styles.getFontOrDefault(STEP_PARAMETER_FONT);
  Paragraph pPhrase = new Paragraph();
  if (includeKeyword) {
    pPhrase.add(new Chunk(step.keyword(), stepKeywordFont));
    pPhrase.add(new Chunk(" "));
  }
  if (!step.isMatching()) {
    pPhrase.add(new Chunk(step.name(), stepPhraseFont));
  } else {
    for (StepExec.Tok tok : step.tokenizeBody()) {
      Font tokFont = stepPhraseFont;
      if (tok.param)
        tokFont = stepParamFont;
      List<Element> richText = emitterContext.emitButCollectElements(new RichText(tok.value, tokFont));
      pPhrase.addAll(richText);
    }
  }
  return pPhrase;
}

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

p.addAll(subs);

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

p.addAll(subs);

相关文章