Created
July 1, 2020 06:44
-
-
Save akash-ch2812/1e2c0991105d0ed2f0fa2cadbee00362 to your computer and use it in GitHub Desktop.
Code for converting PDF file to Image in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pdf2image import convert_from_path | |
pdfs = r"provide path to pdf file" | |
pages = convert_from_path(pdfs, 350) | |
i = 1 | |
for page in pages: | |
image_name = "Page_" + str(i) + ".jpg" | |
page.save(image_name, "JPEG") | |
i = i+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add pdf file name at the end of your file path