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.PdfPTable;
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();
			{
				PdfPTable pTable = new PdfPTable(3);
				pTable.setSplitRows(true);
				pTable.setSplitLate(false);
				
				Phrase ph11 = new Phrase("11");
				pTable.addCell(ph11);
	
				Phrase ph12 = new Phrase("12");
				pTable.addCell(ph12);
				
				Phrase ph13 = new Phrase("13");
				pTable.addCell(ph13);
				
				// -----------------
				
				Phrase ph21 = new Phrase("21");
				pTable.addCell(ph21);
	
				Phrase ph22 = new Phrase("22");
				pTable.addCell(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"+
						"2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n3\n3\n3\n3\n3\n3\n2\n2\n2\n2\n2\n2\n2\n"+
						"");
				pTable.addCell(ph23);
	
				// --------------------
				
				Phrase ph31 = new Phrase("31");
				pTable.addCell(ph31);
	
				Phrase ph32 = new Phrase("32");
				pTable.addCell(ph32);
				
				Phrase ph33 = new Phrase("13");
				pTable.addCell(ph33);
				
				
				document.add(pTable);
			}
			document.close();
			
			System.out.println("Finished ");
		}
		catch (Exception e) {e.printStackTrace();}

	}
}
