I am trying to extract text from a blob triggered PDF file using PyPDF2. However, I am receiving an error of "UnsupportedOperation: seek".
This is my code:
import logging
import azure.functions as func
from io import StringIO
import re
import os
import PyPDF2
def main(myblob: func.InputStream,blobout: func.Out[str],context: func.Context):
logging.info(f"--- Python blob trigger function processed blob \n"
f"----- Name: {myblob.name}\n"
f"----- Blob Size: {myblob.length} bytes")
pdfblob = PyPDF2.PdfFileReader(myblob)
This is the error:
System.Private.CoreLib: Exception while executing function: Functions.Assessment. System.Private.CoreLib: Result: Failure Exception: UnsupportedOperation: seek
I am relatively new to azure functions and would really appreciate the help.
Thank you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.