Example usage for java.lang Exception getMessage

List of usage examples for java.lang Exception getMessage

Introduction

In this page you can find the example usage for java.lang Exception getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:EndOfLinePDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {//from   ww  w. j a  va 2 s.com
        PdfWriter.getInstance(document, new FileOutputStream("EndOfLinePDF.pdf"));

        document.open();

        Chunk chunk = new Chunk("1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4");
        document.add(chunk);

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:FontFactoryStylesBoldPDF.java

public static void main(String[] args) {
    Document document = new Document();

    try {//from   w ww. j  a  v a 2  s  . c  om
        PdfWriter.getInstance(document, new FileOutputStream("FontFactoryStylesBoldPDF.pdf"));
        document.open();

        FontFactory.register("c:\\windows\\fonts\\arialbd.ttf");
        document.add(new Phrase("bold ", FontFactory.getFont("Arial", 8, Font.BOLD)));
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:ImageScalingPercentTwoAxisPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*from   w w w  . j a  v  a 2  s  . c  o m*/
        PdfWriter.getInstance(document, new FileOutputStream("ImageScalingPercentTwoAxisPDF.pdf"));
        document.open();
        Image png = Image.getInstance("logo.png");
        png.scalePercent(100, 50);

        document.add(png);

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:ImageScalingByPercentPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {// ww w.ja va2  s .  c o  m
        PdfWriter.getInstance(document, new FileOutputStream("ImageScalingByPercentPDF.pdf"));
        document.open();
        Image png = Image.getInstance("logo.png");
        png.scalePercent(50);

        document.add(png);

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:AddingParagraphToAPagePDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*w  w  w .  ja  va  2 s  .com*/
        PdfWriter.getInstance(document, new FileOutputStream("AddingParagraphToAPagePDF.pdf"));
        document.open();
        document.add(new Paragraph("First Page."));
        document.setPageSize(PageSize.A3);
        document.newPage();
        document.add(new Paragraph("This PageSize is A3."));
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:ImagesBMPPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {//  w  w  w. j av a2  s  . c o m
        PdfWriter.getInstance(document, new FileOutputStream("ImagesBMPPDF.pdf"));
        document.open();

        document.add(new Paragraph("load a BMP image file"));
        Image img = Image.getInstance("logo.BMP");
        document.add(img);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:ImagesTIFPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {//from ww w  .j  a  v  a  2 s .  c  o m
        PdfWriter.getInstance(document, new FileOutputStream("ImagesTIFPDF.pdf"));
        document.open();

        document.add(new Paragraph("load a tif image file"));
        Image img = Image.getInstance("logo.tif");
        document.add(img);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:FontFactoryStylesPDF.java

public static void main(String[] args) {
    Document document = new Document();

    try {/*from   w  w w .j a va 2  s.c  om*/
        PdfWriter.getInstance(document, new FileOutputStream("FontFactoryStylesPDF.pdf"));
        document.open();

        FontFactory.register("c:\\windows\\fonts\\arial.ttf");
        Phrase myPhrase = new Phrase("This is font family Arial ", FontFactory.getFont("Arial", 8));
        document.add(myPhrase);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:ImagesGIFPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*from  www .  j av  a2  s  .  co m*/
        PdfWriter.getInstance(document, new FileOutputStream("ImagesGIFPDF.pdf"));
        document.open();

        document.add(new Paragraph("load a gif image file"));
        Image img = Image.getInstance("logo.gif");
        document.add(img);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:PhraseInaChunkPDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {//from   ww  w .j  av  a 2 s .co m
        PdfWriter.getInstance(document, new FileOutputStream("PhraseInaChunkPDF.pdf"));

        document.open();

        Phrase phrase = new Phrase(new Chunk("this is a phrase in a chunk\n"));
        document.add(phrase);
    } catch (Exception ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}