List of usage examples for java.io IOException getMessage
public String getMessage()
From source file:DefaultPageSizeA4PDF.java
public static void main(String[] args) { Document document = new Document(); try {/*www . j a va 2s . com*/ PdfWriter.getInstance(document, new FileOutputStream("DefaultPageSizeA4PDF.pdf")); document.open(); document.add(new Paragraph("The default PageSize is DIN A4.")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:HelloWorldPDF.java
public static void main(String[] args) { Document document = new Document(); try {/*from ww w . j av a2 s . c om*/ PdfWriter.getInstance(document, new FileOutputStream("HelloWorldPDF.pdf")); document.open(); document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ClosingAPDFDocument.java
public static void main(String[] args) { Document document = new Document(); try {// www .j ava 2 s . c om PdfWriter.getInstance(document, new FileOutputStream("ClosingAPDFDocument.pdf")); document.open(); document.add(new Paragraph("some text")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:OutputPDFCommandForDebug.java
public static void main(String[] args) { Document document = new Document(); try {//from ww w. j av a 2s.c o m PdfWriter.getInstance(document, System.out); PdfWriter.getInstance(document, new FileOutputStream("OutputPDFCommandForDebug.txt")); document.open(); document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:SpecialSymbolPDF.java
public static void main(String[] args) { Document document = new Document(); try {/*from w ww .j a v a2s . c om*/ PdfWriter.getInstance(document, new FileOutputStream("SpecialSymbolPDF.pdf")); document.open(); for (int i = 913; i < 970; i++) { document.add(Phrase.getInstance(" " + i + ": " + (char) i)); } } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:LandscapePortraitPDF.java
public static void main(String[] args) { Document document = new Document(PageSize.A4.rotate()); try {/*from ww w. j a v a 2 s. c o m*/ PdfWriter.getInstance(document, new FileOutputStream("LandscapePortraitPDF.pdf")); document.open(); document.add(new Paragraph("PageSize.A4.rotate()")); document.setPageSize(PageSize.A4); document.newPage(); document.add(new Paragraph("This is portrait again")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:CreatingANewPagePDF.java
public static void main(String[] args) { Document document = new Document(); try {// ww w.ja v a 2 s . c o m PdfWriter.getInstance(document, new FileOutputStream("CreatingANewPagePDF.pdf")); document.open(); document.add(new Paragraph("First Page.")); document.setPageSize(PageSize.A3); document.newPage(); document.add(new Paragraph("This PageSize is A3.")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:PDFMetaTitle.java
public static void main(String[] args) { Document document = new Document(); try {//from w ww . j a v a2 s .c o m PdfWriter.getInstance(document, new FileOutputStream("PDFMetaTitle.pdf")); document.addTitle("Hello World example"); document.open(); document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:SettingPageBackgroundColorPDF.java
public static void main(String[] args) { Rectangle pageSize = new Rectangle(216, 720); pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE)); Document document = new Document(pageSize); try {/*from w ww . j ava 2s .c o m*/ PdfWriter.getInstance(document, new FileOutputStream("SettingPageBackgroundColorPDF.pdf")); document.open(); document.add(new Paragraph("Text")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:SettingPageSizeA1.java
public static void main(String[] args) { Document document = new Document(); try {// w ww . j a v a2 s. c om PdfWriter.getInstance(document, new FileOutputStream("SettingPageSizeA1.pdf")); document.open(); document.add(new Paragraph("First Page.")); document.setPageSize(PageSize.A1); document.newPage(); document.add(new Paragraph("This PageSize is DIN A1.")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); }