Spaces:
Running
Running
import fitz # PyMuPDF | |
def extract_text_from_pdf(pdf_file): | |
"""Extract text from a given PDF file.""" | |
text = "" | |
with fitz.open(pdf_file) as doc: | |
for page in doc: | |
text += page.get_text() | |
return text |