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

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

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

Paragraph.setLeading介绍

暂无

代码示例

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

private static void setParagraphLeading(Paragraph p, String leading) {
  if (leading == null) {
    p.setLeading(0, 1.5f);
    return;
  }
  try {
    StringTokenizer tk = new StringTokenizer(leading, " ,");
    String v = tk.nextToken();
    float v1 = Float.parseFloat(v);
    if (!tk.hasMoreTokens()) {
      p.setLeading(v1, 0);
      return;
    }
    v = tk.nextToken();
    float v2 = Float.parseFloat(v);
    p.setLeading(v1, v2);
  } catch (Exception e) {
    p.setLeading(0, 1.5f);
  }
}

代码示例来源:origin: com.github.librepdf/pdf-html

private static void setParagraphLeading(Paragraph p, String leading) {
  if (leading == null) {
    p.setLeading(0, 1.5f);
    return;
  }
  try {
    StringTokenizer tk = new StringTokenizer(leading, " ,");
    String v = tk.nextToken();
    float v1 = Float.parseFloat(v);
    if (!tk.hasMoreTokens()) {
      p.setLeading(v1, 0);
      return;
    }
    v = tk.nextToken();
    float v2 = Float.parseFloat(v);
    p.setLeading(v1, v2);
  } catch (Exception e) {
    p.setLeading(0, 1.5f);
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

private static void setParagraphLeading(Paragraph p, String leading) {
  if (leading == null) {
    p.setLeading(0, 1.5f);
    return;
  }
  try {
    StringTokenizer tk = new StringTokenizer(leading, " ,");
    String v = tk.nextToken();
    float v1 = Float.parseFloat(v);
    if (!tk.hasMoreTokens()) {
      p.setLeading(v1, 0);
      return;
    }
    v = tk.nextToken();
    float v2 = Float.parseFloat(v);
    p.setLeading(v1, v2);
  } catch (Exception e) {
    p.setLeading(0, 1.5f);
  }
}

代码示例来源:origin: stackoverflow.com

Paragraph p = new Paragraph(); // or Phrase
p.setLeading( 12f ); // in points

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms

((Paragraph) e).setLeading(leading);
} else if (e instanceof PdfPTable) {
  ((PdfPTable) e).setSpacingBefore(leading);

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms

title = new Paragraph(PdfUtils
    .getChapterfontProperties(defaultFont_));
title.setLeading(20f);
title.setSpacingAfter(40f);
title.add(getChildPhrase(node, data, 0));
title = new Paragraph(PdfUtils.getSectionfontProperties(
    defaultFont_, node.level));
title.setLeading(20f);
title.add(getChildPhrase(node, data, 0));
Section sec = null;

代码示例来源:origin: stackoverflow.com

para.setLeading(leading);

代码示例来源:origin: stackoverflow.com

public PdfPCell getCell3() {
  PdfPCell cell = new PdfPCell();
  Paragraph p1 = new Paragraph("My fantastic data");
  cell.addElement(p1);
  LineSeparator ls = new LineSeparator();
  ls.setOffset(-8);
  cell.addElement(ls);
  Paragraph p2 = new Paragraph("Other data");
  p2.setLeading(25);
  cell.addElement(p2);
  return cell;
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms

public Object visit(WikiParagraph node, Object data) {
  Paragraph p = new Paragraph();
  p.setLeading(20f);
  p.setFirstLineIndent(defaultFont_.size());
  p.setSpacingBefore(paragraphSpacing_);
  p.setSpacingAfter(paragraphSpacing_);
  for (int i = 0; i < node.jjtGetNumChildren(); i++) {
    Object o = node.jjtGetChild(i).jjtAccept(this, data);
    if (o != null)
      p.add(o);
  }
  return p;
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * Constructs a <CODE>Paragraph</CODE> with a certain <CODE>Phrase</CODE>.
 *
 * @param    phrase        a <CODE>Phrase</CODE>
 */    
public Paragraph(Phrase phrase) {
  super(phrase);
  if (phrase instanceof Paragraph) {
    Paragraph p = (Paragraph)phrase;
    setAlignment(p.alignment);
    setLeading(phrase.getLeading(), p.multipliedLeading);
    setIndentationLeft(p.getIndentationLeft());
    setIndentationRight(p.getIndentationRight());
    setFirstLineIndent(p.getFirstLineIndent());
    setSpacingAfter(p.spacingAfter());
    setSpacingBefore(p.spacingBefore());
    setExtraParagraphSpace(p.getExtraParagraphSpace());
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Constructs a <CODE>Paragraph</CODE> with a certain <CODE>Phrase</CODE>.
 *
 * @param    phrase        a <CODE>Phrase</CODE>
 */    
public Paragraph(Phrase phrase) {
  super(phrase);
  if (phrase instanceof Paragraph) {
    Paragraph p = (Paragraph)phrase;
    setAlignment(p.alignment);
    setLeading(phrase.getLeading(), p.multipliedLeading);
    setIndentationLeft(p.getIndentationLeft());
    setIndentationRight(p.getIndentationRight());
    setFirstLineIndent(p.getFirstLineIndent());
    setSpacingAfter(p.spacingAfter());
    setSpacingBefore(p.spacingBefore());
    setExtraParagraphSpace(p.getExtraParagraphSpace());
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Constructs a <CODE>Paragraph</CODE> with a certain <CODE>Phrase</CODE>.
 *
 * @param    phrase        a <CODE>Phrase</CODE>
 */    
public Paragraph(Phrase phrase) {
  super(phrase);
  if (phrase instanceof Paragraph) {
    Paragraph p = (Paragraph)phrase;
    setAlignment(p.alignment);
    setLeading(phrase.getLeading(), p.multipliedLeading);
    setIndentationLeft(p.getIndentationLeft());
    setIndentationRight(p.getIndentationRight());
    setFirstLineIndent(p.getFirstLineIndent());
    setSpacingAfter(p.spacingAfter());
    setSpacingBefore(p.spacingBefore());
    setExtraParagraphSpace(p.getExtraParagraphSpace());
  }
}

代码示例来源:origin: qcadoo/mes

if (i % 2 == 0) {
  Paragraph firstNumberParagraph = new Paragraph(new Phrase(number, FontUtils.getDejavuBold140Dark()));
  firstNumberParagraph.setLeading(0, 0);
  Paragraph numberSmallParagraph = new Paragraph(new Phrase(buildSmallNumber(number),
      FontUtils.getDejavuBold10Dark()));
  numberSmallParagraph.setLeading(0, 0);
  numSmallParagraph.setSpacingAfter(0F);
  secondNumberParagraph.setLeading(0, 0);
  numSmallParagraph.setLeading(0, 0);
  document.add(secondNumberParagraph);

代码示例来源:origin: org.jboss.seam/jboss-seam-pdf

paragraph.setLeading(leading, multipliedLeading);
paragraph.setLeading(leading);

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

p.setLeading(0);
ct.addElement(p);

代码示例来源:origin: com.github.librepdf/openpdf

p.setLeading(0);
ct.addElement(p);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

p.setLeading(0);
ct.addElement(p);

相关文章