0
try
{
  PdfWriter.getInstance(document, new FileOutputStream("sns/home/Desktop/ab.pdf"));
  document.open();
  PdfPTable table=new PdfPTable(3);
  PdfPCell cell1=new PdfPCell(new com.lowagie.text.Paragraph("cell1"));
  PdfPCell cell2=new PdfPCell(new com.lowagie.text.Paragraph("cell2"));
  PdfPCell cell3=new PdfPCell(new com.lowagie.text.Paragraph("cell3"));
  table.addCell(cell1);
  table.addCell(cell2);
  table.addCell(cell3);
  document.add(table);//method add in class document cannot be applied to given types, Required element found PdfPtable.
  document.close();
}
catch(Exception e)
{
  e.printStackTrace();
}
4

0 回答 0