set pdf_endpage to the last page number