ResumeLens / pdf_parser.py
simikkk's picture
Create pdf_parser.py
cc739fc verified
Raw
History Blame Contribute Delete
357 Bytes
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)}"