@Override public void onCloseDocument(PdfWriter writer, Document document) { // Escribimos el contenido al cerrar el documento ColumnText.showTextAligned( total, Element.ALIGN_LEFT, new Phrase(String.valueOf(writer.getPageNumber() - 1)), 2, 2, 0); }