pdf.get_pages should throw error, use pdftk!