Spaces:
Sleeping
Sleeping
File size: 341 Bytes
dbc37da b5a8c65 dbc37da b5a8c65 dbc37da b5a8c65 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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 |