1#The pdf2image library can be used
2#You can install it simply using,
3
4pip install pdf2image
5#Once installed you can use following code to get images.
6
7from pdf2image import convert_from_path
8pages = convert_from_path('pdf_file', 500)
9
10#Saving pages in jpeg format
11
12for page in pages:
13 page.save('out.jpg', 'JPEG')
1# import module
2from pdf2image import convert_from_path
3
4
5# Store Pdf with convert_from_path function
6images = convert_from_path('example.pdf')
7
8for i in range(len(images)):
9
10 # Save pages as images in the pdf
11 images[i].save('page'+ str(i) +'.jpg', 'JPEG')
12
1#The pdf2image library can be used
2#You can install it simply using,
3pip install pdf2image
4
5#Also need to install poppler library using,
6pip install poppler
7#Once installed you can use following code to get images.
8
9from pdf2image import convert_from_path
10pages = convert_from_path('my_pdf_file.pdf', 500)
11
12#Saving pages in png format
13
14for i, page in enumerate(pages):
15 pname = 'page' + str(i) + '.png'
16 page.save(pname, 'PNG')