本文整理汇总了Java中com.itextpdf.text.pdf.PdfPCell.setMinimumHeight方法的典型用法代码示例。如果您正苦于以下问题:Java PdfPCell.setMinimumHeight方法的具体用法?Java PdfPCell.setMinimumHeight怎么用?Java PdfPCell.setMinimumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.setMinimumHeight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParagraph
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private void getParagraph(PdfPTable table, String introText, String content, float minimumHeight) {
Chunk titleChunk = getBoldChunk(introText);
Chunk contentChunk = getContentChunkIfAvailable(content);
PdfPCell titleCell = new PdfPCell(new Phrase(titleChunk));
PdfPCell contentCell = new PdfPCell(new Phrase(contentChunk));
if(minimumHeight > 0) {
titleCell.setMinimumHeight(minimumHeight);
contentCell.setMinimumHeight(minimumHeight);
}
table.addCell(titleCell);
table.addCell(contentCell);
}
示例2: insertCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Insert New row to the table
*
* @param table
* @param text
* @param align
* @param colspan
* @param font
*/
private void insertCell(PdfPTable table, String text, int align, int colspan, Font font) {
//create a new cell with the specified Text and Font
PdfPCell cell = new PdfPCell(new Phrase(text.trim(), font));
//set the cell alignment
cell.setHorizontalAlignment(align);
//set the cell column span in case you want to merge two or more cells
cell.setColspan(colspan);
//in case there is no text and you wan to create an empty row
if (text.trim().equalsIgnoreCase("")) {
cell.setMinimumHeight(10f);
}
//add the call to the table
table.addCell(cell);
}
示例3: writeCommentsSection
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private void writeCommentsSection(final PdfPTable table,
final Font baseFont,
final int height) {
PdfPCell commentLabel = null;
PdfPCell emptySpace = null;
Font font = new Font(baseFont);
font.setStyle(Font.ITALIC);
// This is the 'Comments' section at the bottom of every table for the judge
// to write in
commentLabel = createCell("Comments:", font, NO_BORDERS);
commentLabel.setRotation(90);
commentLabel.setRowspan(1);
commentLabel.setBorderWidthLeft(0);
commentLabel.setBorderWidthBottom(0);
commentLabel.setHorizontalAlignment(Element.ALIGN_CENTER);
commentLabel.setVerticalAlignment(Element.ALIGN_CENTER);
emptySpace = createCell(" ", font, TOP_ONLY);
emptySpace.setMinimumHeight(18f);
table.addCell(commentLabel);
// Need to add the empty cells so the row is complete and is displayed in
// the pdf
for (int i1 = 0; i1 < 5; i1++) {
table.addCell(emptySpace);
}
emptySpace = createCell(" ", font, NO_BORDERS);
for (int i2 = 0; i2 < height; i2++) {
for (int i3 = 0; i3 < 6; i3++) {
table.addCell(emptySpace);
}
}
}
示例4: insertCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private void insertCell(PdfPTable table, String text, int align, int colSpan, Font font){
PdfPCell cell = new PdfPCell(new Phrase(text.trim(), font));
cell.setHorizontalAlignment(align);
cell.setColspan(colSpan);
if(text.trim().equalsIgnoreCase("")){
cell.setMinimumHeight(10f);
}
table.addCell(cell);
}
示例5: writeEndOfPageRow
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public void writeEndOfPageRow(final Document doc) throws DocumentException {
PdfPTable closingTable = new PdfPTable(1);
closingTable.setWidthPercentage(100f);
final StringBuilder strengths = new StringBuilder();
strengths.append("Strengths:");
for (final String category : sheetElement.getCategories()) {
strengths.append(" ");
strengths.append(category);
}
final PdfPCell strengthsCell = createCell(strengths.toString(), f9b, TOP_ONLY, sheetColor);
strengthsCell.setMinimumHeight(18f);
closingTable.addCell(strengthsCell);
boolean somethingRequired = false;
for (final AbstractGoal goal : sheetElement.getSheetData().getGoals()) {
if (goal.isRequired()) {
somethingRequired = true;
}
}
if (somethingRequired) {
final PdfPCell requiredC = createCell("* Required for Award Consideration ", f6Red, NO_BORDERS);
// NO_BORDERS centers
requiredC.setHorizontalAlignment(Element.ALIGN_LEFT);
closingTable.addCell(requiredC);
} else {
closingTable.addCell(createCell(" ", f6Red, NO_BORDERS));
}
if (null != description.getCopyright()) {
// add the copy right statement
final PdfPCell copyrightC = createCell("\u00A9"
+ description.getCopyright(), f6i, NO_BORDERS);
closingTable.addCell(copyrightC);
}
doc.add(closingTable);
doc.newPage();
}