Skip to content

Instantly share code, notes, and snippets.

@AvikantSrivastava
Created April 13, 2021 13:37
Show Gist options
  • Save AvikantSrivastava/092016a7713b981b89b5ada46c6652e4 to your computer and use it in GitHub Desktop.
Save AvikantSrivastava/092016a7713b981b89b5ada46c6652e4 to your computer and use it in GitHub Desktop.
PDF
# Depends on pdf2image and poppler
# import module
from pdf2image import convert_from_path
# Store Pdf with convert_from_path function
images = convert_from_path('example.pdf')
for i in range(len(images)):
# Save pages as images in the pdf
images[i].save('page'+ str(i) +'.jpg', 'JPEG')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment