public void getHeaderFooter(Document document) throws JSONException {
    java.awt.Color tColor = new Color(0, 0, 0);
    fontSmallRegular.setColor(tColor);

    java.util.Date dt = new java.util.Date();
    String dformat = "yyyy-MM-d";
    java.text.SimpleDateFormat dtf = new java.text.SimpleDateFormat(dformat);
    String DateStr = dtf.format(dt);

    // -------- header ----------------

    header = new PdfPTable(1);
    PdfPCell headerNotecell = new PdfPCell(new Phrase("Project Summary Report", fontSmallRegular));
    headerNotecell.setBorder(0);
    headerNotecell.setPaddingBottom(4);
    headerNotecell.setHorizontalAlignment(PdfCell.ALIGN_CENTER);
    header.addCell(headerNotecell);

    PdfPCell headerSeparator = new PdfPCell(new Phrase(""));
    headerSeparator.setBorder(PdfPCell.BOX);
    headerSeparator.setPadding(0);
    headerSeparator.setColspan(1);
    header.addCell(headerSeparator);
    // -------- header end ----------------

    // -------- footer  -------------------
    footer = new PdfPTable(3);
    PdfPCell footerSeparator = new PdfPCell(new Phrase(""));
    footerSeparator.setBorder(PdfPCell.BOX);
    footerSeparator.setPadding(0);
    footerSeparator.setColspan(3);
    footer.addCell(footerSeparator);

    PdfPCell emptyCell = new PdfPCell(new Phrase("", fontSmallRegular));
    emptyCell.setBorder(0);
    emptyCell.setColspan(1);
    emptyCell.setHorizontalAlignment(PdfCell.ALIGN_LEFT);
    footer.addCell(emptyCell);

    PdfPCell footerNotecell = new PdfPCell(new Phrase("Project Summary Report", fontSmallRegular));
    footerNotecell.setBorder(0);
    footerNotecell.setColspan(1);
    footerNotecell.setHorizontalAlignment(PdfCell.ALIGN_CENTER);
    footer.addCell(footerNotecell);

    PdfPCell pagerDateCell = new PdfPCell(new Phrase(DateStr, fontSmallRegular));
    pagerDateCell.setBorder(0);
    pagerDateCell.setColspan(1);
    pagerDateCell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
    footer.addCell(pagerDateCell);

    // -------- footer end   -----------
  }