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

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

Introduction

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

Prototype

public void setPadding(float padding) 

Source Link

Document

Sets the padding of the contents in the cell (space between content and border).

Usage

From source file:tk.diginspect.main.SoOFSignatories.java

private void insertCell1(PdfPTable table, String text, float borderWidthTop, float borderWidthBottom,
        float fixedHeight) {
    PdfPCell cell = new PdfPCell(new Paragraph(Font.TIMES_ROMAN, text));
    cell.setBackgroundColor(WebColors.getRGBColor("#FFFFFF"));
    cell.setPadding(5);
    cell.setBorderWidthTop(borderWidthTop);
    cell.setBorderWidthBottom(borderWidthBottom);
    cell.setFixedHeight(fixedHeight);/*from   w w  w.  j a  va2s.c  om*/
    table.addCell(cell);
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void nested(PdfPTable table, float column1, float column2, int directives, boolean checkmark,
        int align) {
    float[] nestedcolumnWidths = { column1, column2 };
    PdfPTable nested = new PdfPTable(nestedcolumnWidths);
    if (checkmark == true) {
        Checked(nested, align, R.drawable.checked);
    } else if (checkmark == false) {
        Checked(nested, align, R.drawable.unchecked);
    }//  ww w. ja  va  2  s.  com

    String Directives = getResources().getString(directives);
    PdfPCell cell = new PdfPCell(new Paragraph(Font.TIMES_ROMAN, Directives));
    cell.setPadding(5);
    cell.setBorderWidth(0);
    nested.addCell(cell);

    PdfPCell nesthousing = new PdfPCell(nested);
    nesthousing.setBorderWidthTop(0);
    nesthousing.setBorderWidthBottom(0);

    table.addCell(nesthousing);
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void Checked(PdfPTable table, int align, int checkmark) {
    try {/* ww w. j  a  v  a  2 s .c o m*/
        ByteArrayOutputStream streamChecked = new ByteArrayOutputStream();
        Bitmap Checked = BitmapFactory.decodeResource(getBaseContext().getResources(), checkmark);
        Checked.compress(Bitmap.CompressFormat.JPEG, 100, streamChecked);
        Image ImgChecked = null;
        ImgChecked = Image.getInstance(streamChecked.toByteArray());
        ImgChecked.scalePercent(25f);
        PdfPCell cell = new PdfPCell(ImgChecked, false);
        cell.setHorizontalAlignment(align);
        cell.setPadding(5);
        cell.setBorder(0);
        table.addCell(cell);
    } catch (BadElementException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void sig(PdfPTable table, String image) {
    try {// www.  ja v a  2  s . c o m
        FileInputStream fis = openFileInput(image);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        Bitmap bitmap = BitmapFactory.decodeStream(fis);
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
        Image Img = null;
        Img = Image.getInstance(stream.toByteArray());
        Img.scalePercent(10f);
        PdfPCell cell = new PdfPCell(Img, false);
        cell.setPadding(10);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setBorderWidthBottom(0);
        table.addCell(cell);
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (BadElementException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}