Pagination functionality added to documents