Spaces:
Sleeping
Sleeping
| import fitz # pymupdf | |
| def get_pdf_text(pdf_docs): | |
| text = "" | |
| for pdf in pdf_docs: | |
| try: | |
| doc = fitz.open(pdf) | |
| for page in doc: | |
| text += page.get_text("text") | |
| except Exception as e: | |
| st.error(f"Error reading {pdf.name}: {e}") | |
| continue | |
| return text | |