Skip to content

getTables returns empty tables #82

@higgsaxhh

Description

@higgsaxhh

I'm prototyping a Node application to parse pdf files.

Version 2.4.5

Here is a code snippet:

  if (mimeType !== "application/pdf") {
    throw new Error(`Unsupported file type: ${mimeType}`);
  }

  try {
    const parser = new PDFParse({ url: path });
    const info = await parser.getInfo({ parsePageInfo: true });
    const text = await parser.getText();
    const table = await parser.getTable();

    console.log(table);
    await parser.destroy();
  } catch (error) {
    console.error("Error processing PDF:", error);
    throw error;
  }

  return "OK";

The following is logged to the console:

Pr {
  pages: [ { num: 1, tables: [] }, { num: 2, tables: [] } ],
  mergedTables: [],
  total: 2
}

The input file is a two page pdf with 11 prominent tables, like this

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions