Function pdfIteratePages

  • Parse text content of each page in a PDF file. Array indices correspond to page numbers.

    Parameters

    • filepath: string

      The path to the PDF file.

    • Optional begin: number

      The page number to start from. If not provided, defaults to the first page.

    • Optional end: number

      The page number to end at. If not provided, defaults to the last page.

    Returns AsyncGenerator<string>

    An async generator that yields the text content of each page in the PDF.

    Throws

    Will yield an empty string if an error occurs while processing a page.

    Example

    for await (const pageText of pdfIteratePages('path/to/file.pdf')) {
    console.log(pageText);
    }

Generated using TypeDoc