Hands-on case studyOffice Document Processing

PDF Content Extraction: a Tokeny case study

Extract text and table data from PDF files and convert to editable formats. Follow the recorded task, execution screenshots, actual files and verification notes.

By the Tokeny team · Windows · Tokeny 1.7.8 · gpt-6-sol

Prepare the inputs

Create a separate workspace in Tokeny, download and unpack the sample inputs, then select a model that supports tools. The sample uses synthetic data or the public sources named in the article.

  • invoice.pdf
Download sample inputs

Send the task to Tokeny

The original task was executed in Chinese. Copying these instructions reproduces the same task; the results below include an English report.

读取本地演示发票 PDF,提取文字和明细表成 CSV、Markdown,核对数量乘单价及总额。不要将 OCR 推测当作已确认金额。

交付文件:invoice.csv、extracted.md。
验收要点:
- 提取 3 条明细
- 总金额 380 元
- 保留来源页码
这是使用合成演示输入或指定公开资料的真实操作案例。请先读取工作空间输入,再实际生成文件并自检。所有写入、脚本与临时服务限于当前工作空间;临时服务只监听 127.0.0.1,执行后关闭;不触达外部收件人、不发布、不付款、不更改系统设置,不调用子智能体。需要公开资料时可读取给定 URL。只启用完成任务必需的工具。另写 report.md(中文)和 report.en.md(英文),简洁、完整,包含输入、处理步骤、真实结果、检查方式和局限;失败或未验证部分如实记录,不能宣称成功。最终回复用中文列出产物、关键结果与待核实项。
排版检查:Word 主标题仅出现一次,标题为黑色且与后续正文或表格保持同页;Excel 表头和长文字不能被窄列截断,合理设置列宽、换行、行高;HTML 在 390px 视口不能整页横向溢出。报告没有固定字数要求,不要为字数反复改写。

The recorded run used an isolated demonstration workspace. Review the commands and file paths before approving operations in your own workspace.

What actually ran

The task was submitted through the Tokeny input box. An online model read the inputs and executed tools. A synthetic invoice exercises extraction of line items and the total.

The actual Tokeny 1.7.8 session and files for PDF Content Extraction. Open the image at full size.
The actual Tokeny 1.7.8 session and files for PDF Content Extraction. Open the image at full size.

Results and verification

Input

Read invoice.pdf from the workspace. It is a one-page synthetic demo invoice and states “Not a tax document” and “Synthetic input for Tokeny scenario testing”.

Processing Steps

  1. Used pypdf to read the page count and text layer for each page.
  2. Confirmed that page 1 contains complete, copyable invoice text, so no OCR inference was used as an amount source.
  3. Extracted the item, quantity, unit price, amount, and source page for three line items.
  4. Calculated quantity multiplied by unit price for each line, then summed the calculated amounts.
  5. Wrote the results to invoice.csv and extracted.md, then checked the outputs.

Actual Results

  • Extracted line items: 3.
  • Notebook: 10 × 12.00 = CNY 120.00; matches the source amount.
  • Pen: 20 × 3.00 = CNY 60.00; matches the source amount.
  • Folder: 10 × 20.00 = CNY 200.00; matches the source amount.
  • Calculated line-item total: CNY 380.00.
  • Total stated in the PDF: CNY 380.00.
  • Result: the calculated line-item total matches the PDF total; all values come from the page 1 text layer.

Verification Method

Checked quantity, unit price, and extracted amount row by row. Used decimal currency arithmetic for quantity × unit_price, then checked that the three calculated amounts sum to Total: CNY 380.00. Also confirmed that the CSV contains three detail rows, a total row, and a source_page field.

Limitations

This is a synthetic demo input, not a tax document. This task does not assess tax validity, business authenticity, or currency conversion. Because the text layer was complete, no OCR amount inference was made and there are no unverified amount fields.

Download and inspect the outputs

The archive contains the files created during this run. Use these checks when adapting the example to your own data.

  • Reconcile the reported results against the downloadable sample inputs.
  • Open the generated files and check the contents relevant to your task.
  • Review the limitations and any unverified steps in the report.
invoice.csv · 1 KBextracted.md · 2 KBreport.md · 1 KBreport.en.md · 2 KB
Download actual outputs

More in this category