Belval / pdf2image

A python module that wraps the pdftoppm utility to convert PDF to PIL Image object
MIT License
1.66k stars 195 forks source link

Enhancement: Add Support for Specifying and Converting Specific Pages from PDF (Issue #285 Resolved) #292

Open cyy-2024 opened 1 month ago

cyy-2024 commented 1 month ago

Dear Reviewer,

Your project is absolutely fantastic! My submission adds a new feature to the PDF conversion module, addressing the issue raised in #285, which allows users to specify and convert only certain pages from a PDF. This enhancement gives users more flexibility to extract the needed pages from a PDF and convert them to images, without having to convert the entire PDF document.

During the implementation, I added the page_indexes parameter to receive user-specified page indexes. The program first converts all pages into images in memory, then filters and saves only the pages matching the page_indexes. This approach not only avoids unnecessary page conversions but also ensures that users process only the pages they need. If there are any mistakes, please kindly point them out as I’m new to the GitHub community. Thank you so much for your time and support!