PDF 转 Excel
把 PDF 里的表格提取到电子表格中。
这款工具完全在你的浏览器中运行。文件从不上传,你可以在浏览器的网络标签中亲自验证这一点。 亲自验证:打开浏览器的网络标签观察。你会看到一个查询你是否还有剩余任务的小请求,只包含工具名称和一段哈希,绝不会包含文件。
这款工具的作用
This finds the tables in a document and writes them into an .xlsx workbook. A PDF never records that something is a table, so the columns are located geometrically, from the vertical gutters that survive every row. Values that read cleanly as numbers are written as numbers, which is the difference between a column you can sum immediately and one Excel refuses to add up.
Bank statements, invoice line items, a supplier price list published only as a PDF, the results table in a report you need to chart - anywhere the figures are visible on the page and retyping them is the only other option.
工作原理
- Drop the PDF onto this page. One file at a time, up to 200 MB.
- Leave the confidence threshold at 55%. Lower it if a table was missed, raise it if something that is not a table came out as one.
- Leave joining across pages on for a table that continues overleaf, or switch on a sheet per page to keep them separate.
- Leave the header row option on so a heading repeated on a continuation page is not written in as data.
- Press Convert to Excel.
- Check the first and last rows of each sheet, where detection is least certain.
Two facts drive the detection. The first is that numeric columns align on their right edge, not their left, so a detector clustering only the start of each run reads 12.00 and 1,234.00 as two different columns - exactly on the financial statements that are most of what anyone converts. Alignment here is scored on the best of the start, end and centre consistency, so a left-aligned description column and a right-aligned money column both score well in the same table.
The second is that a wrong table is worse than no table. Two columns of prose have pin-sharp left edges and a wide gutter down the middle, and by alignment alone they look better than most real tables. Geometry cannot separate them, so there is a further gate on what the columns contain, and it rejects outright rather than quietly lowering the score. That is why a page of newspaper-style text does not arrive as a two-column spreadsheet.
Numbers keep the formatting they were printed with, and it has to come off before a cell can hold a real number: thousands separators, currency symbols, trailing percent signs, and negatives written in accountancy brackets, which become a minus. A comma is only removed when exactly three digits follow it, because it is a thousands separator in English and a decimal point in Indonesian. Anything still ambiguous stays text on purpose - a misplaced decimal point is worse than an unformatted cell.
When nothing reads as a table, the tool says so and points at PDF to text rather than handing you an empty workbook, which would imply the document had nothing in it. Lowering the confidence threshold is the first thing to try; reading the page with PDF to text is the second.
Detection and the writing of the workbook both happen on your device, the OOXML built and zipped in the browser, so a bank statement is never sent anywhere to be read. That matters more here than on most tools: the documents people convert to spreadsheets are usually the ones with account numbers on them.
这款工具做不到的事
- Tables drawn with ruled lines are still found by their text alignment. The rules themselves live in the page graphics, which this pass does not read, so a table held together only by its lines and irregular spacing may be missed.
- Merged cells are not reconstructed. A heading spanning three columns lands in the first of them and the other two come out empty.
- Only values come across. Fonts, colours, borders, column widths and number formats are not carried into the workbook.
常见问题
- 它是怎样找到表格的?
- 靠几何。文本层给出每个字形的位置,而一段每一行的墨迹都分隔成相同纵向间隔的行块会被当作表格。每个候选会按其各列对齐得有多一致来打分,低于你设定阈值的都会被丢弃。另有一道内容检查会剔除散文列,否则它们的得分会比真正的表格还高。
- 数字过来后会是我能求和的数字吗?
- 会,只要它们没有歧义。货币符号、千位分隔符、结尾的百分号,以及会计括号都会被去掉,括号里的值会变成负数。只有当逗号后正好跟着三位数字时,它才会被当作千位分隔符,因为在印度尼西亚语里它是小数点。任何无法干净解析的内容都会保持为文本,而不是去猜测。
- 它漏掉了一张表格,或者找到了并不存在的表格。现在怎么办?
- 调整置信度阈值。它的取值从 30 到 90,起始为 55;调低它会放进较弱的候选,找到更多表格,代价是会有一些误判。如果在任何设置下都找不到,那这一页可能没有真正的列结构,而「PDF 转文本」会让你看到它到底包含什么。
- 我的表格跨了好几页。它会被拆开吗?
- 默认不会。如果一张表格在某页顶部开始,列数与上一页底部结束的那张相同,它就会被当作续表,合并到一个工作表里,而它重复的表头行会被丢弃,而不是作为数据写入。开启「每页一个工作表」可以让它们分开。
- 我的对账单会被上传到什么地方吗?
- 不会。检测和工作簿的生成都在你的浏览器中进行,文档的任何部分都不会被传输。这可以在开发者工具的网络标签里核实,而且这款工具在断网时也能继续使用。