Fix pdf.extract_pages