With Aspose.PDF for Java you can add pages, add headers and footers, add watermarks into your PDF file. This section explain to you all details on this topic.... Add Page number using PageNumberStamp class...- you can learn how to get numbers in PDF file, get page properties...