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

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

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

Paragraph.getFont介绍

暂无

代码示例

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

/**
 * Constructs a Paragraph that will be used as title for a Section or Chapter.
 * @param    title    the title of the section
 * @param    numbers    a list of sectionnumbers
 * @param    numberDepth    how many numbers have to be shown
 * @param    numberStyle    the numbering style
 * @return    a Paragraph object
 * @since    iText 2.0.8
 */
public static Paragraph constructTitle(final Paragraph title, final ArrayList<Integer> numbers, final int numberDepth, final int numberStyle) {
  if (title == null) {
    return null;
  }
  int depth = Math.min(numbers.size(), numberDepth);
  if (depth < 1) {
    return title;
  }
  StringBuffer buf = new StringBuffer(" ");
  for (int i = 0; i < depth; i++) {
    buf.insert(0, ".");
    buf.insert(0, numbers.get(i).intValue());
  }
  if (numberStyle == NUMBERSTYLE_DOTTED_WITHOUT_FINAL_DOT) {
    buf.deleteCharAt(buf.length() - 2);
  }
  Paragraph result = new Paragraph(title);
  result.add(0, new Chunk(buf.toString(), title.getFont()));
  return result;
}

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

/**
 * Constructs a Paragraph that will be used as title for a Section or Chapter.
 * @param    title    the title of the section
 * @param    numbers    a list of sectionnumbers
 * @param    numberDepth    how many numbers have to be shown
 * @param    numberStyle    the numbering style
 * @return    a Paragraph object
 * @since    iText 2.0.8
 */
public static Paragraph constructTitle(final Paragraph title, final ArrayList<Integer> numbers, final int numberDepth, final int numberStyle) {
  if (title == null) {
    return null;
  }
  int depth = Math.min(numbers.size(), numberDepth);
  if (depth < 1) {
    return title;
  }
  StringBuffer buf = new StringBuffer(" ");
  for (int i = 0; i < depth; i++) {
    buf.insert(0, ".");
    buf.insert(0, numbers.get(i).intValue());
  }
  if (numberStyle == NUMBERSTYLE_DOTTED_WITHOUT_FINAL_DOT) {
    buf.deleteCharAt(buf.length() - 2);
  }
  Paragraph result = new Paragraph(title);
  result.add(0, new Chunk(buf.toString(), title.getFont()));
  return result;
}

代码示例来源:origin: fr.opensagres.xdocreport/fr.opensagres.xdocreport.itext5.extension

result.add( 0, new Chunk( buf.toString(), title.getFont() ) );
return result;

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

if ((paragraph.getFont() != null) && (paragraph.getFont().getColor() != null)) {
  BaseColor c = paragraph.getFont().getColor();
  setColorAttribute(c, obj, PdfName.COLOR);

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

if ((paragraph.getFont() != null) && (paragraph.getFont().getColor() != null)) {
  BaseColor c = paragraph.getFont().getColor();
  setColorAttribute(c, obj, PdfName.COLOR);

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

protected void populateProperties(Paragraph copy, boolean spacingBefore) {
  copy.setFont(getFont());
  copy.setAlignment(getAlignment());
  copy.setLeading(getLeading(), multipliedLeading);
  copy.setIndentationLeft(getIndentationLeft());
  copy.setIndentationRight(getIndentationRight());
  copy.setFirstLineIndent(getFirstLineIndent());
  copy.setSpacingAfter(getSpacingAfter());
  if (spacingBefore)
    copy.setSpacingBefore(getSpacingBefore());
  copy.setExtraParagraphSpace(getExtraParagraphSpace());
  copy.setRole(role);
  copy.id = getId();
  if (accessibleAttributes != null)
    copy.accessibleAttributes = new HashMap<PdfName, PdfObject>(accessibleAttributes);
  copy.setTabSettings(getTabSettings());
  copy.setKeepTogether(getKeepTogether());
}

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

protected void populateProperties(Paragraph copy, boolean spacingBefore) {
  copy.setFont(getFont());
  copy.setAlignment(getAlignment());
  copy.setLeading(getLeading(), multipliedLeading);
  copy.setIndentationLeft(getIndentationLeft());
  copy.setIndentationRight(getIndentationRight());
  copy.setFirstLineIndent(getFirstLineIndent());
  copy.setSpacingAfter(getSpacingAfter());
  if (spacingBefore)
    copy.setSpacingBefore(getSpacingBefore());
  copy.setExtraParagraphSpace(getExtraParagraphSpace());
  copy.setRole(role);
  copy.id = getId();
  if (accessibleAttributes != null)
    copy.accessibleAttributes = new HashMap<PdfName, PdfObject>(accessibleAttributes);
  copy.setTabSettings(getTabSettings());
  copy.setKeepTogether(getKeepTogether());
}

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

text.openMCBlock(paragraph);
addSpacing(paragraph.getSpacingBefore(), leading, paragraph.getFont());
  carriageReturn();
  if (oldHeight != currentHeight || lines.size() > 0) {
    addSpacing(paragraph.getSpacingAfter(), paragraph.getTotalLeading(), paragraph.getFont(), true);

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

text.openMCBlock(paragraph);
addSpacing(paragraph.getSpacingBefore(), leading, paragraph.getFont());
  carriageReturn();
  if (oldHeight != currentHeight || lines.size() > 0) {
    addSpacing(paragraph.getSpacingAfter(), paragraph.getTotalLeading(), paragraph.getFont(), true);

相关文章