Example usage for com.itextpdf.text Image setBorderWidth

List of usage examples for com.itextpdf.text Image setBorderWidth

Introduction

In this page you can find the example usage for com.itextpdf.text Image setBorderWidth.

Prototype

public void setBorderWidth(final float borderWidth) 

Source Link

Document

Sets the borderwidth of the table.

Usage

From source file:utils.pdf.cv_templates.Template1.java

private void addImageLine3() throws DocumentException, IOException {
    Image line_img;
    line_img = Image/*from  w  w w  .j a va  2  s .c o  m*/
            .getInstance(String.format("public/images/orientation/cv-templates/CV1/ic_barra_lineas3.png"));
    line_img.setAbsolutePosition(40, 350);
    line_img.setAlignment(Image.LEFT | Image.TEXTWRAP);
    line_img.setBorder(Image.BOX);
    line_img.setBorderWidth(10);
    line_img.setBorderColor(BaseColor.WHITE);
    line_img.scaleToFit(1000, 100);
    document.add(line_img);
}

From source file:utils.pdf.cv_templates.Template1.java

private void addImageLine4() throws DocumentException, IOException {
    Image line_img;
    line_img = Image//w w w  . j  av a  2s .  c o  m
            .getInstance(String.format("public/images/orientation/cv-templates/CV1/ic_barra_lineas3.png"));
    line_img.setAbsolutePosition(40, 450);
    line_img.setAlignment(Image.LEFT | Image.TEXTWRAP);
    line_img.setBorder(Image.BOX);
    line_img.setBorderWidth(10);
    line_img.setBorderColor(BaseColor.WHITE);
    line_img.scaleToFit(1000, 100);
    document.add(line_img);
}

From source file:utils.pdf.cv_templates.Template1.java

private void addImageLine5() throws DocumentException, IOException {
    Image line_img;
    line_img = Image//from w  w  w.jav a  2  s .  c  o m
            .getInstance(String.format("public/images/orientation/cv-templates/CV1/ic_barra_lineas3.png"));
    line_img.setAbsolutePosition(40, 550);
    line_img.setAlignment(Image.LEFT | Image.TEXTWRAP);
    line_img.setBorder(Image.BOX);
    line_img.setBorderWidth(10);
    line_img.setBorderColor(BaseColor.WHITE);
    line_img.scaleToFit(1000, 100);
    document.add(line_img);
}

From source file:utils.pdf.cv_templates.Template3.java

private void addLineImage() throws DocumentException, IOException {
    Image short_line_img = Image.getInstance(SHORT_LINE_IMAGE);
    short_line_img.setAbsolutePosition(213, 756);
    short_line_img.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    short_line_img.setBorderWidth(10);
    short_line_img.setBorderColor(BaseColor.WHITE);
    short_line_img.scaleToFit(300, 55);
    document.add(short_line_img);
}

From source file:utils.pdf.cv_templates.Template3.java

private void addAcademicExperience(User user) throws DocumentException, IOException {
    Paragraph paragraph1, paragraph2;//from   w  w  w .j  a va  2  s  . com
    PdfPCell cell1, cell2, cell3;
    PdfPTable table1, table2, table3;

    // TABLE 1
    table1 = new PdfPTable(new float[] { 5 });
    table1.setWidthPercentage(100);
    cell1 = new PdfPCell();
    cell1.setBorder(PdfPCell.NO_BORDER);
    cell1.setPaddingRight(15);
    cell1.setPaddingLeft(50);
    cell1.setPaddingTop(15);

    paragraph1 = new Paragraph("Experiencia acadmica", font1);
    paragraph1.setAlignment(paragraph1.ALIGN_LEFT);
    cell1.addElement(paragraph1);
    table1.addCell(cell1);
    document.add(table1);

    // TABLE 2
    table2 = new PdfPTable(new float[] { 9, 1 });
    table2.setWidthPercentage(100);

    // First column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    cell2.setPaddingTop(5);
    Image long_line_img = Image.getInstance(LONG_LINE_IMAGE);
    long_line_img.setBorderWidth(10);
    long_line_img.setBorderColor(BaseColor.WHITE);
    long_line_img.scaleToFit(475, 50);
    cell2.addElement(long_line_img);
    //cell2.setBorderColor(Constants.COLOR_BLUE_T3);
    //cell2.setBorderWidthTop(2);
    table2.addCell(cell2);

    // Second column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    table2.addCell(cell2);

    document.add(table2);

    // TABLE 3
    table3 = new PdfPTable(new float[] { 5 });
    table3.setWidthPercentage(100);
    cell3 = new PdfPCell();
    cell3.setBorder(PdfPCell.NO_BORDER);
    cell3.setPaddingRight(15);
    cell3.setPaddingLeft(50);
    cell3.setPaddingTop(-1);
    paragraph2 = new Paragraph(user.studyTitle.toUpperCase() + ".\n" + user.studyLocation.toUpperCase() + ".",
            font3);
    paragraph2.setAlignment(paragraph2.ALIGN_LEFT);
    cell3.addElement(paragraph2);
    table3.addCell(cell3);
    document.add(table3);
}

From source file:utils.pdf.cv_templates.Template3.java

private void addProfessionalExperience(List<ProfessionalExperience> experienceList)
        throws DocumentException, IOException {
    Paragraph paragraph1, paragraph2;//from w  w  w.  j a v a  2s. com
    PdfPCell cell1, cell2, cell3;
    PdfPTable table1, table2, table3;

    // TABLE 1
    table1 = new PdfPTable(new float[] { 5 });
    table1.setWidthPercentage(100);
    cell1 = new PdfPCell();
    cell1.setBorder(PdfPCell.NO_BORDER);
    cell1.setPaddingRight(15);
    cell1.setPaddingLeft(50);
    cell1.setPaddingTop(15);

    paragraph1 = new Paragraph("Experiencia Profesional", font1);
    paragraph1.setAlignment(paragraph1.ALIGN_LEFT);
    cell1.addElement(paragraph1);
    table1.addCell(cell1);
    document.add(table1);

    // TABLE 2
    table2 = new PdfPTable(new float[] { 9, 1 });
    table2.setWidthPercentage(100);

    // First column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    cell2.setPaddingTop(5);
    Image long_line_img = Image.getInstance(LONG_LINE_IMAGE);
    long_line_img.setBorderWidth(10);
    long_line_img.setBorderColor(BaseColor.WHITE);
    long_line_img.scaleToFit(475, 50);
    cell2.addElement(long_line_img);
    table2.addCell(cell2);

    // Second column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    table2.addCell(cell2);

    document.add(table2);

    // TABLE 3
    for (int i = 0; i < experienceList.size(); i++) {
        table3 = new PdfPTable(new float[] { 6, 4 });
        table3.setWidthPercentage(100);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        if (i == 0) {
            cell3.setPaddingTop(-1);
        }

        paragraph2 = new Paragraph(experienceList.get(i).job.toUpperCase() + ".\n"
                + experienceList.get(i).company.toUpperCase() + ".", font3);
        paragraph2.setSpacingBefore(10);
        cell3.addElement(paragraph2);

        table3.addCell(cell3);

        //Second column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        if (i == 0) {
            cell3.setPaddingTop(-1);
        }

        paragraph2 = new Paragraph(experienceList.get(i).startDate.toUpperCase() + " - "
                + experienceList.get(i).endDate.toUpperCase() + ".", font3);
        paragraph2.setAlignment(paragraph2.ALIGN_LEFT);
        cell3.addElement(paragraph2);

        table3.addCell(cell3);
        document.add(table3);
    }
}

From source file:utils.pdf.cv_templates.Template3.java

private void addSoftware(List<Software> softwareList) throws DocumentException, IOException {
    Paragraph paragraph1, paragraph2;//w w w. j a  va  2s .c  o  m
    PdfPCell cell1, cell2, cell3;
    PdfPTable table1, table2, table3;

    // TABLE 1
    table1 = new PdfPTable(new float[] { 5 });
    table1.setWidthPercentage(100);
    cell1 = new PdfPCell();
    cell1.setBorder(PdfPCell.NO_BORDER);
    cell1.setPaddingRight(15);
    cell1.setPaddingLeft(50);
    cell1.setPaddingTop(15);

    paragraph1 = new Paragraph("Programas informticos", font1);
    paragraph1.setAlignment(paragraph1.ALIGN_LEFT);
    cell1.addElement(paragraph1);
    table1.addCell(cell1);
    document.add(table1);

    // TABLE 2
    table2 = new PdfPTable(new float[] { 9, 1 });
    table2.setWidthPercentage(100);

    // First column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    cell2.setPaddingTop(5);
    Image long_line_img = Image.getInstance(LONG_LINE_IMAGE);
    long_line_img.setBorderWidth(10);
    long_line_img.setBorderColor(BaseColor.WHITE);
    long_line_img.scaleToFit(475, 50);
    cell2.addElement(long_line_img);
    table2.addCell(cell2);

    // Second column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    table2.addCell(cell2);

    document.add(table2);

    // TABLE 3
    for (int i = 0; i < softwareList.size(); i++) {
        table3 = new PdfPTable(new float[] { 6, 4 });
        table3.setWidthPercentage(100);
        table3.setSpacingBefore(5);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        if (i == 0) {
            cell3.setPaddingTop(-1);
        }

        paragraph2 = new Paragraph(softwareList.get(i).software + ".", font3);
        paragraph2.setSpacingBefore(10);
        cell3.addElement(paragraph2);

        table3.addCell(cell3);

        //Second column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        if (i == 0) {
            cell3.setPaddingTop(-1);
        }

        paragraph2 = new Paragraph(softwareList.get(i).level + ".", font3);
        paragraph2.setAlignment(paragraph2.ALIGN_LEFT);
        cell3.addElement(paragraph2);

        table3.addCell(cell3);
        document.add(table3);
    }
}

From source file:utils.pdf.cv_templates.Template3.java

private void addLanguages(List<Language> languages) throws DocumentException, IOException {
    Paragraph paragraph1, paragraph2;/*from w w w  .j  av  a2s .c o  m*/
    PdfPCell cell1, cell2, cell3;
    PdfPTable table1, table2, table3;

    // TABLE 1
    table1 = new PdfPTable(new float[] { 5 });
    table1.setWidthPercentage(100);
    cell1 = new PdfPCell();
    cell1.setBorder(PdfPCell.NO_BORDER);
    cell1.setPaddingRight(15);
    cell1.setPaddingLeft(50);
    cell1.setPaddingTop(15);

    paragraph1 = new Paragraph("Idiomas", font1);
    paragraph1.setAlignment(paragraph1.ALIGN_LEFT);
    cell1.addElement(paragraph1);
    table1.addCell(cell1);
    document.add(table1);

    // TABLE 2
    table2 = new PdfPTable(new float[] { 9, 1 });
    table2.setWidthPercentage(100);

    // First column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    cell2.setPaddingTop(5);
    Image long_line_img = Image.getInstance(LONG_LINE_IMAGE);
    long_line_img.setBorderWidth(10);
    long_line_img.setBorderColor(BaseColor.WHITE);
    long_line_img.scaleToFit(475, 50);
    cell2.addElement(long_line_img);
    table2.addCell(cell2);

    // Second column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    table2.addCell(cell2);

    document.add(table2);

    //TABLE 3
    for (int i = 0; i < languages.size(); i++) {
        table3 = new PdfPTable(new float[] { 6 });
        table3.setWidthPercentage(100);
        table3.setSpacingBefore(5);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        if (i == 0) {
            cell3.setPaddingTop(-1);
        }

        paragraph2 = new Paragraph(languages.get(i).language + ". " + languages.get(i).level + ".", font3);
        paragraph2.setSpacingBefore(10);
        cell3.addElement(paragraph2);

        table3.addCell(cell3);
        document.add(table3);
    }
}

From source file:utils.pdf.cv_templates.Template3.java

private void addSkills(User user, List<String> personalCharacteristics, List<Skill> skills)
        throws DocumentException, IOException {
    Paragraph paragraph1, paragraph2;//from   w  w  w . j ava  2  s  .c om
    PdfPCell cell1, cell2, cell3;
    PdfPTable table1, table2, table3;

    // TABLE 1
    table1 = new PdfPTable(new float[] { 5 });
    table1.setWidthPercentage(100);
    cell1 = new PdfPCell();
    cell1.setBorder(PdfPCell.NO_BORDER);
    cell1.setPaddingRight(15);
    cell1.setPaddingLeft(50);
    cell1.setPaddingTop(15);

    paragraph1 = new Paragraph("Cualidades", font1);
    paragraph1.setAlignment(paragraph1.ALIGN_LEFT);
    cell1.addElement(paragraph1);
    table1.addCell(cell1);
    document.add(table1);

    // TABLE 2
    table2 = new PdfPTable(new float[] { 9, 1 });
    table2.setWidthPercentage(100);

    // First column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    cell2.setPaddingTop(5);
    Image long_line_img = Image.getInstance(LONG_LINE_IMAGE);
    long_line_img.setBorderWidth(10);
    long_line_img.setBorderColor(BaseColor.WHITE);
    long_line_img.scaleToFit(475, 50);
    cell2.addElement(long_line_img);
    table2.addCell(cell2);

    // Second column
    cell2 = new PdfPCell();
    cell2.setBorder(PdfPCell.NO_BORDER);
    table2.addCell(cell2);

    document.add(table2);

    // TABLE 3
    List<String> rankedSkills = selectSkills(skills);
    if (personalCharacteristics.size() != 0 && rankedSkills.size() != 0) {
        table3 = new PdfPTable(new float[] { 6 });
        table3.setWidthPercentage(100);
        table3.setSpacingBefore(5);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2 = new Paragraph(
                "Me defino como una persona de carcter " + personalCharacteristics.get(1).toLowerCase()
                        + " y " + personalCharacteristics.get(0).toLowerCase() + ".",
                font3);
        paragraph2.setAlignment(Paragraph.ALIGN_LEFT);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        cell3.setPaddingTop(-1);

        cell3.addElement(paragraph2);
        table3.addCell(cell3);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2 = new Paragraph("Entre mis puntos fuertes destacan las " + rankedSkills.get(0).toLowerCase()
                + " y las " + rankedSkills.get(1).toLowerCase() + ".", font3);
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2.setAlignment(Paragraph.ALIGN_LEFT);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        cell3.addElement(paragraph2);
        table3.addCell(cell3);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2 = new Paragraph(
                "Considero que soy una persona activa que presenta " + rankedSkills.get(2).toLowerCase() + ".",
                font3);
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2.setAlignment(Paragraph.ALIGN_LEFT);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        cell3.addElement(paragraph2);
        table3.addCell(cell3);

        //First column
        cell3 = new PdfPCell();
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2 = new Paragraph("Adems, una de las caractersticas que me define es que soy "
                + personalCharacteristics.get(2).toLowerCase() + ".", font3);
        cell3.setBorder(PdfPCell.NO_BORDER);
        paragraph2.setAlignment(Paragraph.ALIGN_LEFT);
        cell3.setPaddingRight(15);
        cell3.setPaddingLeft(50);
        cell3.addElement(paragraph2);
        table3.addCell(cell3);

        document.add(table3);

    }
}

From source file:utils.pdf.cv_templates.Template4.java

private void addImage(User user) throws DocumentException, IOException {
    Image photo_img;
    if (!user.photo.id.equals("")) {
        photo_img = Image/*  w ww  .j a va2  s .  co m*/
                .getInstance(String.format("https://s3.amazonaws.com/aunclickdelempleo2/" + user.photo.id));
    } else {
        photo_img = Image.getInstance(String.format("public/images/orientation/photo/ic_profile.png"));
    }

    photo_img.setAbsolutePosition(450, 690);
    photo_img.setAlignment(Image.LEFT | Image.TEXTWRAP);
    photo_img.setBorder(Image.BOX);
    photo_img.setBorderWidth(10);
    photo_img.setBorderColor(BaseColor.WHITE);
    photo_img.scaleToFit(1000, 115);
    document.add(photo_img);
}