/** * Creates an empty cell. * * @param colspan The column span of the cell. * @param height The height of the column. * @return A PdfCell. */ public static PdfPCell getEmptyCell( int colSpan, int height ) { PdfPCell cell = new PdfPCell(); cell.setColspan( colSpan ); cell.setBorder( 0 ); cell.setMinimumHeight( height ); return cell; }
cell.setMinimumHeight(35f); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
public void createPdf(String dest) throws IOException, DocumentException { Rectangle pagesize = PageSize.LETTER; Document document = new Document(pagesize); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest)); document.open(); PdfPTable table = new PdfPTable(2); PdfPCell cell; //Add rows with selectors PdfFormField selectGroup = PdfFormField.createEmpty(writer); selectGroup.setFieldName("myCombos"); String[] options = {"Choose first option", "Choose second option", "Choose third option"}; String[] exports = {"option1", "option2", "option3"}; table.addCell("Combobox:"); cell = new PdfPCell(); cell.setCellEvent(new SelectCellEvent(selectGroup, "combo1", exports, options)); cell.setMinimumHeight(20); table.addCell(cell); document.add(table); writer.addAnnotation(selectGroup); document.close(); }
/** * Creates a cell. * * @param text The text to include in the cell. * @param colspan The column span of the cell. * @param font The font of the cell text. * @param horizontalAlign The vertical alignment of the text in the cell. * @return A PdfCell. */ public static PdfPCell getCell( String text, int colspan, Font font, int horizontalAlign ) { Paragraph paragraph = new Paragraph( text, font ); PdfPCell cell = new PdfPCell( paragraph ); cell.setColspan( colspan ); cell.setBorder( 0 ); cell.setMinimumHeight( 15 ); cell.setHorizontalAlignment( horizontalAlign ); return cell; }
monday.setMinimumHeight(15f); monday.setLeading(0f, 1.2f); mondayvalue.setMinimumHeight(15f); mondayvalue.setLeading(0f, 1.2f); Planned.setMinimumHeight(15f); Planned.setLeading(0f, 1.2f); activity.setMinimumHeight(15f); activity.setLeading(0f, 1.2f);
cell.setMinimumHeight (document.getPageSize ().getHeight () - 36.0f - 36.0f); cell.setVerticalAlignment (Element.ALIGN_BOTTOM); cell.addElement (createTable ());
private PdfPCell createMinHeight(float minH) { PdfPCell cell = new PdfPCell(); PdfPTable table = new PdfPTable(1); cell.setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.setHeaderRows(0); PdfPCell firstRow = new PdfPCell(); firstRow.setBorder(Rectangle.NO_BORDER); firstRow.setMinimumHeight(minH); firstRow.setPadding(0); table.addCell(firstRow); table.addCell(""); cell.setPadding(0); cell.addElement(table); return cell; }
public static PdfPCell getPdfPCell( float minHeight, int cellContentType, boolean hasBorder ) cell.setMinimumHeight( minHeight );
if ( minRowHeight != null ) super.setMinimumHeight( minRowHeight );
if ( minRowHeight != null ) super.setMinimumHeight( minRowHeight );
minimumHeight); if (minimumHeight != null) { cell.setMinimumHeight(minimumHeight);
cell.setFixedHeight(fixHs[k]); else cell.setMinimumHeight(minHs[k]);
cell.setFixedHeight(fixHs[k]); else cell.setMinimumHeight(minHs[k]);
cell.setFixedHeight(fixHs[k]); else cell.setMinimumHeight(minHs[k]);