// image.setAbsolutePosition(450, 730);
// writer.addDirectImageSimple(image);
//
doc.open();
PdfPTable headerTable= new PdfPTable(2);
Image ii = Image.getInstance("c:/smi-logo.gif");
ii.setAlignment(Element.ALIGN_RIGHT);
ii.scalePercent(25);
PdfPCell cell1 = new PdfPCell(ii,false);
cell1.setBorder(0);
headerTable.addCell(cell1);
// cell = borderlessCell("Code of Doom Order Form");
Date now = new Date();
System.out.println("date--> " + now);
DateFormat df = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
String s1 = df.format(now);
Chunk CONNECT = new Chunk(new LineSeparator(5.5f, 95, Color.BLUE, Element.ALIGN_CENTER, 3.5f));
// LineSeparator UNDERLINE =new LineSeparator(1, 100, null, Element.ALIGN_CENTER, -2);
//public HeaderFooter getMyHeader(String titulo) throws ServletException {
// Phrase p= new Phrase();
// Chunk chunkTemp = new Chunk("My Company Name\n", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL);
// p.add(chunkTemp);
// chunkTemp = new Chunk("_____________________________________________________________________________________________________", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL);
// p.add(chunkTemp);
// HeaderFooter header = new HeaderFooter(p, false);
// return header;
headerTable.addCell(main.borderlessCell(s1));
// headerTable.addCell(borderlessCell("Customer Name"));
// headerTable.addCell(borderlessCell(c.getName()));
// headerTable.addCell(borderlessCell("Address"));
// headerTable.addCell(borderlessCell(c.getAddress()));
// headerTable.addCell(borderlessCell("Phone Number"));
// headerTable.addCell(borderlessCell(c.getPhone()));
doc.add(headerTable);
// Phrase phrase = new Phrase(50);
// doc.add(phrase);
Paragraph paragraph = new Paragraph( "");
main.addEmptyLine(paragraph,10);
paragraph.add(CONNECT);
doc.add( paragraph );
// Chunk c = new Chunk( text, font );
// c.setAction( new PdfAction( new URL( url ) ) );
// c.setUnderline(0.8f, -0.8f);
// doc.add( c );
PdfPTable tab=new PdfPTable(6);
PdfPCell cell = new PdfPCell(new Paragraph("Process Details"));
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setBackgroundColor(new Color(20,105,160));
cell.setColspan(6);
tab.addCell(cell);
tab.addCell("id");
tab.addCell("pid");
tab.addCell("mid");
tab.addCell("processname");
tab.addCell("workingsetsize");
tab.addCell("date");
doc.add(tab);
PdfPTable table=new PdfPTable(i);
Iterator it =list.iterator();
while(it.hasNext())
{
Object o[]=(Object [])it.next();
// System.out.println(o[0] + "==" + o[1]);
// String str=(String) it.next();
for(int j=0; j<i; j++ )
{
System.out.println(o[j]);
//table.addCell(o[j]);//String.valueOf(list.get(i).getProcessName()));
table.addCell(String.valueOf(o[j]));
}}
System.out.println("loop complate");
doc.add(table);
System.out.println("add table complate");