i++;
PdfImportedPage page2 = writer.getImportedPage(reader, i);
cb.addTemplate(page2, .5f, 0, 0, .5f, width / 2 + 60, 120);
}
BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
cb.beginText();
cb.setFontAndSize(bf, 14);
cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "page " + p + " of " + ((n / 2) + (n % 2 > 0? 1 : 0)), width / 2, 40, 0);
cb.endText();
}
// step 5: we close the document