import fitz # PyMuPDF def extract_text_from_pdf(file_path): text = "" with fitz.open(file_path) as pdf: for page in pdf: text += page.get_text() return text.strip()