Python3: Download PDF to memory and convert first page to image
问题 i try to do the following: Download a PDF file to memory Convert the first page to an image Use that image with tweepy I tried the following code, but run into an error. from PIL import Image from pdf2image import convert_from_path from urllib.request import urlopen from io import StringIO, BytesIO url = 'http://somedomain.com/assets/applets/internet.pdf' scrape = urlopen(url) # for external files pdfFile = BytesIO(scrape.read()) pdfFile.seek(0) pages = convert_from_path(pdfFile,last_page=1,