Spaces:
Configuration error
Configuration error
import fitz # PyMuPDF | |
def extract_text_from_pdf(file) -> str: | |
doc = fitz.open(stream=file.read(), filetype="pdf") | |
text = "" | |
for page in doc: | |
text += page.get_text() | |
return text.strip() | |