Spaces:
Sleeping
Sleeping
| import pdfplumber | |
| def extract_text_from_pdf(file_path: str) -> str: | |
| if file_path is None: | |
| return "" | |
| try: | |
| with pdfplumber.open(file_path) as pdf: | |
| pages = [page.extract_text() or "" for page in pdf.pages] | |
| return "\n".join(pages).strip() | |
| except Exception as e: | |
| return f"Chyba při čtení PDF: {str(e)}" |