当前位置: 首页>>代码示例>>Java>>正文


Java PdfPCell.setMinimumHeight方法代码示例

本文整理汇总了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);
}
 
开发者ID:krispena,项目名称:cbsp-reports,代码行数:13,代码来源:TreeReportWriter.java

示例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);
}
 
开发者ID:budthapa,项目名称:Create-PDF-in-Java-,代码行数:25,代码来源:createPDF.java

示例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);
    }
  }
}
 
开发者ID:jpschewe,项目名称:fll-sw,代码行数:34,代码来源:SubjectivePdfWriter.java

示例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);

}
 
开发者ID:rohaniitr,项目名称:helpEx_Android,代码行数:12,代码来源:ExperimentTable.java

示例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();
}
 
开发者ID:jpschewe,项目名称:fll-sw,代码行数:41,代码来源:SubjectivePdfWriter.java


注:本文中的com.itextpdf.text.pdf.PdfPCell.setMinimumHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。