本文整理汇总了Java中com.itextpdf.text.pdf.PdfPCell.setLeading方法的典型用法代码示例。如果您正苦于以下问题:Java PdfPCell.setLeading方法的具体用法?Java PdfPCell.setLeading怎么用?Java PdfPCell.setLeading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.setLeading方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Obtain a cell with the given value.
* @param value Value to display in the cell.
* @return A cell with the given value.
*/
private PdfPCell getCell(String value)
{
PdfPCell cell = new PdfPCell(new Phrase(new Chunk(value, this.font)));
cell.setLeading(8, 0);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
return cell;
}
示例2: writePostBodyFooter
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* @see org.displaytag.render.TableWriterTemplate#writePostBodyFooter(org.displaytag.model.TableModel)
* @throws DocumentException if an error occurs while writing post-body footer.
*/
@Override
protected void writePostBodyFooter(TableModel model) throws DocumentException
{
Chunk cellContent = new Chunk(model.getFooter(), this.getFooterFont());
this.setFooterFontStyle(cellContent);
PdfPCell cell = new PdfPCell(new Phrase(cellContent));
cell.setLeading(8, 0);
cell.setBackgroundColor(this.getFooterBackgroundColor());
cell.setHorizontalAlignment(this.getFooterHorizontalAlignment());
cell.setColspan(model.getNumberOfColumns());
table.addCell(cell);
}
示例3: getCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Returns a formatted cell for the given value.
* @param value cell value
* @return Cell
* @throws BadElementException if errors occurs while generating content.
*/
private PdfPCell getCell(Object value)
{
PdfPCell cell = new PdfPCell(new Phrase(new Chunk(StringUtils.trimToEmpty(value != null
? value.toString()
: StringUtils.EMPTY), this.defaultFont)));
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setLeading(8, 0);
return cell;
}
示例4: getHeaderCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Obtain a header cell.
* @param value Cell content.
* @return A header cell with the given content.
*/
private PdfPCell getHeaderCell(String value)
{
Chunk cellContent = new Chunk(value, this.getHeaderFont());
setHeaderFontStyle(cellContent);
PdfPCell cell = new PdfPCell(new Phrase(cellContent));
cell.setLeading(8, 0);
cell.setHorizontalAlignment(this.getHeaderHorizontalAlignment());
cell.setBackgroundColor(this.getHeaderBackgroundColor());
return cell;
}
示例5: getCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Returns a formatted cell for the given value.
* @param value cell value
* @return Cell
*/
private PdfPCell getCell(String value)
{
PdfPCell cell = new PdfPCell(new Phrase(new Chunk(StringUtils.trimToEmpty(value), smallFont)));
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setLeading(8, 0);
cell.setPadding(2);
return cell;
}