footer.disableBorderSide(Rectangle.TOP);
footer.disableBorderSide(Rectangle.BOTTOM);
// Set the footer alignment to the center
footer.setAlignment(Rectangle.ALIGN_CENTER);
header.disableBorderSide(Rectangle.TOP);
header.disableBorderSide(Rectangle.BOTTOM);
// Set the footer alignment to the right
header.setAlignment(Rectangle.ALIGN_RIGHT);
doc.setHeader(header);