public void onEndPage(PdfWriter writer, Document document) {
		if (this.numberPos > 0) {
			float width = document.getPageSize().getWidth();
			float height = document.getPageSize().getHeight();
			try {
				if (total == null)
					total = writer.getDirectContent().createTemplate(30, 16);
				if (this.hasTotleNumber)
					this.pagenumbertable = new PdfPTable(2);
				else
					this.pagenumbertable = new PdfPTable(1);
				pagenumbertable.setTotalWidth(50f);
				pagenumbertable.setLockedWidth(true);
				pagenumbertable.getDefaultCell().setFixedHeight(20);
				pagenumbertable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
				if (this.hasTotleNumber)
					pagenumbertable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
				else
					pagenumbertable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
				pagenumbertable.addCell(Integer.toString(writer.getPageNumber()));
				if (this.hasTotleNumber) {
					PdfPCell cell = new PdfPCell(Image.getInstance(total));
					cell.setBorder(Rectangle.NO_BORDER);
					pagenumbertable.addCell(cell);
				}
				switch (numberPos) {
				case 3:
					pagenumbertable.writeSelectedRows(0, -1, width * 0.9f, height * 0.95f, writer.getDirectContent());
//					ColumnText.showTextAligned(writer.getDirectContent(),
//							Element.ALIGN_CENTER, new Phrase("< "+String.valueOf(writer
//									.getPageNumber())+" >"), width * 0.95f, height * 0.95f, 0);
					break;
				case 9:
					pagenumbertable.writeSelectedRows(0, -1, width * 0.9f, height * 0.05f, writer.getDirectContent());
//					ColumnText.showTextAligned(writer.getDirectContent(),
//							Element.ALIGN_CENTER, new Phrase(String.valueOf(writer
//									.getPageNumber())), width * 0.93f, height * 0.05f, 0);
					break;
				case 8:
					pagenumbertable.writeSelectedRows(0, -1, width * 0.5f, height * 0.05f, writer.getDirectContent());
//					ColumnText.showTextAligned(writer.getDirectContent(),
//							Element.ALIGN_CENTER, new Phrase("< "+String.valueOf(writer
//									.getPageNumber())+" >"), width * 0.5f, height * 0.05f, 0);
					break;
				default:
					break;
				}
			} catch (Exception e) {
				throw new ExceptionConverter(e);
			}
		}
	}