Example usage for com.lowagie.text.pdf PdfPCell setPaddingRight

List of usage examples for com.lowagie.text.pdf PdfPCell setPaddingRight

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPCell setPaddingRight.

Prototype

public void setPaddingRight(float paddingRight) 

Source Link

Document

Setter for property paddingRight.

Usage

From source file:uk.ac.ox.oucs.vle.resources.PDFWriter.java

License:Educational Community License

private PdfPCell nameCell(String name, String webauthId, String department) {

    Phrase phrase = new Phrase();
    phrase.add(new Chunk(name, tableNameFont));
    phrase.add(Chunk.NEWLINE);//from   w  w w . j  av a 2s  . co  m
    StringBuilder otherDetails = new StringBuilder();
    if (webauthId != null && webauthId.trim().length() > 0) {
        otherDetails.append(webauthId);
    }
    if (department != null && department.trim().length() > 0) {
        if (otherDetails.length() > 0) {
            otherDetails.append(" ");
        }
        otherDetails.append(department);
    }
    phrase.add(new Chunk(otherDetails.toString(), tableOtherFont));

    PdfPCell pdfCell = new PdfPCell(phrase);
    pdfCell.setMinimumHeight(tableNameFont.getSize() * 2f);
    pdfCell.setHorizontalAlignment(Element.ALIGN_LEFT);
    pdfCell.setVerticalAlignment(Element.ALIGN_CENTER);
    pdfCell.setPaddingBottom(tableNameFont.getSize() * 0.5f);
    pdfCell.setPaddingTop(tableNameFont.getSize() * 0.5f);
    pdfCell.setPaddingLeft(tableNameFont.getSize());
    pdfCell.setPaddingRight(tableNameFont.getSize());
    return pdfCell;
}