Spaces:
Sleeping
Sleeping
| import fitz # PyMuPDF | |
| def extract_text_from_pdf(file_path): | |
| """ | |
| Extract text from PDF using PyMuPDF | |
| """ | |
| text = "" | |
| try: | |
| doc = fitz.open(file_path) | |
| for page in doc: | |
| text += page.get_text() | |
| except Exception as e: | |
| text = "" | |
| print(f"PDF extraction error: {e}") | |
| return text |