Phrase content = new Phrase("Blah blah blah", Font); Float fontSize = content.getFont().getSize(); Float capHeight = content.getFont().getBaseFont().getFontDescriptor(BaseFont.CAPHEIGHT, fontSize); Float padding = 5f; PdfPCell cell = new PdfPCell(content); cell.setPadding(padding); cell.setPaddingTop(capHeight - fontSize + padding);
/** * Copy constructor for <CODE>Phrase</CODE>. * @param phrase the Phrase to copy */ public Phrase(final Phrase phrase) { super(); this.addAll(phrase); setLeading(phrase.getLeading(), phrase.getMultipliedLeading()); font = phrase.getFont(); tabSettings = phrase.getTabSettings(); setHyphenation(phrase.getHyphenation()); }
/** * Copy constructor for <CODE>Phrase</CODE>. * @param phrase the Phrase to copy */ public Phrase(final Phrase phrase) { super(); this.addAll(phrase); setLeading(phrase.getLeading(), phrase.getMultipliedLeading()); font = phrase.getFont(); tabSettings = phrase.getTabSettings(); setHyphenation(phrase.getHyphenation()); }