from urllib.request import urlopen
from pdfminer.pdfdevice import PDFDevice
from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager
from pdfminer.pdfparser import PDFDocument, PDFParser
from pdfminer.layout import LAParams
from pdfminer.converter import PDFPageAggregator
问题解决了
device=PDFPageAggregator(resource,laparam=laparam)