"""Extract all text from a PDF file using PyPDF2."""

import PyPDF2


def extract_pdf_text(pdf_path: str) -> str:
    """Extract all text from a PDF file.

    Args:
        pdf_path: Path to the PDF file.

    Returns:
        str: Concatenated text from all pages.
    """
    pdf_reader = PyPDF2.PdfReader(pdf_path)
    text = ""
    for page in pdf_reader.pages:
        text += page.extract_text() or ""
    return text
