Add pagination and update PDF within a single page