try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document,
new GfrFileOutputStream("com.lowagie.examples.objects.tables.alternatives.TableWithImage.pdf"));
// step 3: we open the document
document.open();
// step 4: we create a table and add it to the document
Table table = new Table(2, 2); // 2 rows, 2 columns
table.addCell(new LwgCell(LwgImage.getInstance("otsoe.jpg")));