Skip to content

Instantly share code, notes, and snippets.

@akash-ch2812
Created July 1, 2020 06:44
Show Gist options
  • Save akash-ch2812/1e2c0991105d0ed2f0fa2cadbee00362 to your computer and use it in GitHub Desktop.
Save akash-ch2812/1e2c0991105d0ed2f0fa2cadbee00362 to your computer and use it in GitHub Desktop.
Code for converting PDF file to Image in Python
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
@OmkarPatkar
Copy link

Add pdf file name at the end of your file path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment