Export a table to Excel
export_tableConvert a table from one PDF page into an .xlsx workbook and preview the rows. Detects lined tables automatically, or reads a set area, with amounts stored as numbers.
Instructions
Reads the table on one page of a PDF and writes it as an .xlsx workbook, and returns the rows found as a preview. Without an area, a table drawn with lines is found by itself; otherwise the whole page is read. Rows and columns follow the table's lines when it has them; amounts (1.234,56 or 1,234.56) become numbers, codes and dates stay text. Use it for tables you want to calculate with; for plain text use extract_text. Scanned pages need recognize_text first; a page without text is an error. The original is not changed, and an existing output file is only replaced with overwrite: true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| area | No | Optional area in points from the page's top-left corner. | |
| page | Yes | Page number (1-based). | |
| path | Yes | Absolute path of the PDF. | |
| output | Yes | Absolute path of the .xlsx file to write. | |
| password | No | Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it. | |
| overwrite | No | Allow replacing an existing file (default false). |