import java.io.FileOutputStream;

import com.lowagie.text.Cell;
import com.lowagie.text.Document;
import com.lowagie.text.Phrase;
import com.lowagie.text.Rectangle;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;

/*
 * Created on 11-gen-2005
 * by Mattia Dongili
 * Copyright 2005 Siemens S.p.a.
 */

/**
 * @author mdongili
 */
public class ITextTest {

	public static void main(String[] args) {
		try {
			Document document = new Document(new Rectangle(595,842), 50, 50, 125, 100); 
			PdfWriter w = PdfWriter.getInstance(
					document, 
					new FileOutputStream("C:\\AAAA.pdf"));
		
			document.open();
			{
				Table pTable = new Table(3);
				pTable.setCellsFitPage(false);
				pTable.setTableFitsPage(false);
				
				Phrase ph11 = new Phrase("11");
				pTable.addCell(new Cell(ph11));
	
				Phrase ph12 = new Phrase("12");
				pTable.addCell(new Cell(ph12));
				
				Phrase ph13 = new Phrase("13");
				pTable.addCell(new Cell(ph13));
				
				// -----------------
				
				Phrase ph21 = new Phrase("21");
				pTable.addCell(new Cell(ph21));
	
				Phrase ph22 = new Phrase("22");
				pTable.addCell(new Cell(ph22));
	
				Phrase ph23 = new Phrase(
						"3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n"+
						"3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n"+
						"");
				pTable.addCell(new Cell(ph23));
	
				// --------------------
				
				Phrase ph31 = new Phrase("31");
				pTable.addCell(new Cell(ph31));
	
				Phrase ph32 = new Phrase("32");
				pTable.addCell(new Cell(ph32));
				
				Phrase ph33 = new Phrase("13");
				pTable.addCell(new Cell(ph33));
				
				
				document.add(pTable);
			}
			document.close();
			
			System.out.println("Finished ");
		}
		catch (Exception e) {e.printStackTrace();}

	}
}
