Document doc = new Document(PageSize.A4.rotate(), 0, 0, 0, 0);
PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream(output));
doc.open();
// splitLine(doc, writer);
PdfContentByte cb = writer.getDirectContent();
float bottom = (doc.top() - pageSize.getHeight()) / 2 + kOffset;
float left = doc.right() / 2 - (pageSize.getWidth() + kTextWidth) / 2 - kMargin;
float right = doc.right() / 2 - (pageSize.getWidth() - kTextWidth) / 2 + kMargin;
for (int i = 0; i <= n;) {
PdfImportedPage page = getPage(writer, reader, i++);