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

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

Introduction

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

Prototype

public void setPaddingLeft(float paddingLeft) 

Source Link

Document

Setter for property paddingLeft.

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);//w  ww.  j  a v  a2 s .  c om
    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;
}