private void createPdf()
{
try {
Document document = new Document (PageSize.A4, 0, 0, 0, 0) {};
PdfWriter.getInstance(document, new FileOutputStream("report.pdf"));
document.open();
document.setMargins(0, 0, 0, 0);

// Paragraph title1 = new Paragraph();
// Chapter chapter1 = new Chapter(1);
// Section section1 = chapter1.addSection(title1);
// chapter1.setNumberDepth(0);
// Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1",
// FontFactory.getFont(FontFactory.HELVETICA,16,Font.BOLD,new Color(255, 0, 0)));
// Section section1 = chapter1.addSection(title11);
// Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1.");
// section1.add(someSectionText);
// someSectionText = new Paragraph("Following is a 3 X 2 table.");
// section1.add(someSectionText);
List contactList=allContactlList;
int i=contactList.size()/2;
Font f1=new Font("Verdana", Font.PLAIN, 12);
Table t = new Table(2,i);
// t.setBorderColor(new Color(220, 255, 100));
t.setPadding(2);
t.setSpacing(10);
t.setBorderWidth(0);

for(int j=0;j<contactList.size();j++)
{
Contact contact=(Contact)contactList.get(j);
String contactText="Name : "+contact.getContactname()+"\n"
+"Address : "+contact.getAddress()+"\n"
+"Phone : "+contact.getPhone()+"\n"
+"E-mail : "+contact.getEmail();

Cell c1 = new Cell(contactText);
c1.setMaxLines(4);
//c1.setWidth("10");
//c1.setc
//c1.setBorder(1);
t.addCell(c1);
}


//section1.add(t);
document.add(t);



document.close();
} catch (Exception e) {
e.printStackTrace();
}
}