Example usage for com.itextpdf.text Image setAlignment

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

Introduction

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

Prototype


public void setAlignment(final int alignment) 

Source Link

Document

Sets the alignment for the image.

Usage

From source file:report.pdfs.Herd_PDF_Report.java

private void addBarChart(Section catPart) {
    Herd_Bar_Chart_Report chart = new Herd_Bar_Chart_Report(show, "Herd Expenses Overview");
    Image To_be_Added = null;
    try {/*from  w  w  w .  j a  v a  2 s .c  o  m*/
        To_be_Added = Image.getInstance("bar_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Herd_PDF_Report.java

private void addPieChart(Section catPart) {
    Herd_Pie_Chart_Report chart = new Herd_Pie_Chart_Report(show, "Comparison", "Herd Expenses Overview");
    Image To_be_Added = null;
    try {/*from  w  w  w  . ja v a2s  . c  o m*/
        To_be_Added = Image.getInstance("pie_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Labour_PDF_Report.java

private void addBarChart(Section catPart) {
    Labour_Bar_Chart_Report chart = new Labour_Bar_Chart_Report(show, "Labour Expenses Overview");
    Image To_be_Added = null;
    try {/*from   w w w  . j  a va  2  s . c o  m*/
        To_be_Added = Image.getInstance("bar_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Labour_PDF_Report.java

private void addPieChart(Section catPart) {
    Labour_Pie_Chart_Report chart = new Labour_Pie_Chart_Report(show, "Comparison", "Labour Expenses Overview");
    Image To_be_Added = null;
    try {//from   w w w . jav a  2  s .  c o  m
        To_be_Added = Image.getInstance("pie_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Lighting_PDF_Report.java

private void addBarChart(Section catPart) {
    Lighting_Bar_Chart_Report chart = new Lighting_Bar_Chart_Report(show, "Lighting Expenses Overview");
    Image To_be_Added = null;
    try {/*ww w.j  av  a 2s  .  c o m*/
        To_be_Added = Image.getInstance("bar_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Lighting_PDF_Report.java

private void addPieChart(Section catPart) {
    Lighting_Pie_Chart_Report chart = new Lighting_Pie_Chart_Report(show, "Comparison",
            "Lighting Expenses Overview");
    Image To_be_Added = null;
    try {/*from ww  w  . j  av  a 2  s .  c  om*/
        To_be_Added = Image.getInstance("pie_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Machinery_PDF_Report.java

private void addBarChart(Section catPart) {
    Machinery_Bar_Chart_Report chart = new Machinery_Bar_Chart_Report(show, "Machinery Expenses Overview");
    Image To_be_Added = null;
    try {//from www.  j  a  va2s.  c  om
        To_be_Added = Image.getInstance("bar_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Machinery_PDF_Report.java

private void addPieChart(Section catPart) {
    Machinery_Pie_Chart_Report chart = new Machinery_Pie_Chart_Report(show, "Comparison",
            "Machinery Expenses Overview");
    Image To_be_Added = null;
    try {/*from   w  ww  .j  a va 2s  .  com*/
        To_be_Added = Image.getInstance("pie_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Medical_PDF_Report.java

private void addBarChart(Section catPart) {
    Medical_Bar_Chart_Report chart = new Medical_Bar_Chart_Report(show, "Medical Expenses Overview");
    Image To_be_Added = null;
    try {/*from w  w w .ja v a  2s.c  o  m*/
        To_be_Added = Image.getInstance("bar_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}

From source file:report.pdfs.Medical_PDF_Report.java

private void addPieChart(Section catPart) {
    Medical_Pie_Chart_Report chart = new Medical_Pie_Chart_Report(show, "Comparison",
            "Medical Expenses Overview");
    Image To_be_Added = null;
    try {//from   w  w  w.  j  av a 2 s . c o  m
        To_be_Added = Image.getInstance("pie_chart.png");
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    To_be_Added.setAlignment(Image.MIDDLE | Image.TEXTWRAP);
    //To_be_Added.setBorder(Image.BOX);
    //To_be_Added.setBorderWidth(15);

    catPart.add(To_be_Added);
}