from pdf2image import convert_from_path,convert_from_bytes
import os
#将20张pdf转化为图片
for i in range(20):
image = convert_from_path('pdf_gen/{}.pdf'.format(i))
image.save(os.path.join('img/','{}.jpg'.format(i)),'JPEG', quality=100)
print('crop {} images'.format(i + 1))