Hi,
Below is the code:
Pdf pdf = new Pdf();
//add a section
Section sec1 = pdf.getSections().add();
MarginInfo marginInfo = new MarginInfo();
marginInfo.setTop(24);
marginInfo.setBottom(24);
marginInfo.setLeft(72);
marginInfo.setRight(24);
sec1.getPageSetup().setMargin(marginInfo);
Text text1 = new Text(sec1,"Description");
text1.getTextInfo().setTrueTypeBold(true);
sec1.getParagraphs().add(text1);
MarginInfo marginInfo2 = new MarginInfo();
marginInfo.setTop(48);
marginInfo.setBottom(24);
marginInfo.setLeft(36);
marginInfo.setRight(36);
Table table = new Table(sec1);
table.setColumnWidths("135 150 125 90");
table.setMargin(marginInfo2);
//add a row
Row row21 = new Row(table);
table.getRows().add(row21);
table.getDefaultCellTextInfo().setTrueTypeBold(false);
table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
Cell cell211 = new Cell(table, "Updated");
row21.getCells().add(cell211);
table.getDefaultCellTextInfo().setTrueTypeBold(false);
table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
Cell cell212 = new Cell(table,"S. Smith");
row21.getCells().add(cell212);
table.getDefaultCellTextInfo().setTrueTypeBold(false);
table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
Cell cell213 = new Cell(table,"Jan 2006");
row21.getCells().add(cell213);
table.getDefaultCellTextInfo().setTrueTypeBold(false);
table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
Cell cell214 = new Cell(table,"Updated - Testing.");
row21.getCells().add(cell214);
sec1.getParagraphs().add(table);
//add a header to section sec1
HeaderFooter head = new HeaderFooter(sec1);
Text headText = new Text(sec1,"Report Header");
head.getParagraphs().add(headText);
sec1.setOddHeader(head);
//add a footer to section sec1
HeaderFooter foot = new HeaderFooter(sec1);
Table table2 = new Table(sec1);
table2.setColumnWidths("150 150 150");
table2.setMargin(marginInfo2);
//Action Item Details
Row row1_t2 = new Row(table2);
table2.getDefaultCellTextInfo().setFontName("Arial");
table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
table2.getDefaultCellTextInfo().setTrueTypeBold(true);
table2.getDefaultCellTextInfo().setFontSize(9);
table2.getRows().add(row1_t2);
Cell cell1_t2 = new Cell(table2, "Project Details");
row1a.getCells().add(cell1_t2);
Cell cell2_t2 = new Cell(table2, "Project Info");
table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Center);
row1a.getCells().add(cell2_t2);
Cell cell3_t2 = new Cell(table2, "Details");
table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Right);
row1a.getCells().add(cell3_t2);
foot.getParagraphs().add(table2);
sec1.setOddFooter(foot);
FileOutputStream out = new FileOutputStream(new File("HeaderAndFooterExample.pdf"));
pdf.save(out);