跳到主要内容

解析文档 Make

本模块的功能

PDF4me 解析文档 使用您保存的解析模板对 PDFMake 场景并返回提取的字段,以便映射到下一个模块。从 Dropbox、Google Drive、OneDrive 等传输文件内容 HTTP引用模板 模板名称(TemplateId)并将解析后的值直接路由到 Airtable、Google Sheets、数据库或下游电子邮件中。模板包含提取逻辑,因此只需一次模块调用即可处理发票、合同、收据以及您配置的任何自定义布局。

相关博客文章(1)

运行此模块之前: 在解析模板中创建解析模板 PDF4me 仪表板。定义您的捕获密钥并选择 正则表达式 对于稳定模式或 JavaScript 表达 用于条件逻辑。 Make 模块引用该模板 模板 ID。 看 准备文档解析信息 完整设置请参见正则表达式示例(INV-\d{6,10}\d{2}/\d{2}/\d{4}),以及两个工作单位 JavaScript 表达式分类器样本。

验证您的身份 API 要求

PDF4me 模块 Make 需要有效 联系创建或选择一个可以容纳您的 PDF4me API 关键在于确保场景能够安全地验证解析请求。

您不容错过的重要事实

模板名称接受模板 ID GUID
尽管字段标签可能有所不同,但请粘贴控制面板中的 GUID TemplateId,而不是易于理解的模板名称。GUID 在重命名后保持不变,是生产环境中的安全之选。
用于稳定模式的正则表达式 JavaScript 用于条件逻辑
捕获规则位于模板中。使用正则表达式捕获发票编号、日期、金额和税号。 JavaScript 用……表达 文本 用于分类和回退规则的变量。
一个解析模板,适用于所有平台
相同的 TemplateId 在 Maken8nZapierPower Automate以及直接 REST 调用。只需创建一次模板,即可在团队自动化操作的任何地方重复使用。
在 Make 中解析文档模块

参数

范围必需的它的作用例子
ConnectionYesPDF4me connection that authenticates the module. Click Add to create one with your API key, or pick an existing connection from the dropdown.PDF4me production
File ContentYesBinary PDF mapped from a previous module: Dropbox Download a File, Google Drive Get a File, OneDrive Download a File, HTTP Get a File, Gmail Get an Attachment, or any module that returns a file.1. Data
File NameYesSource filename including .pdf extension. Usually mapped from the same upstream module File Name output.1. File Name
Template NameYesTemplateId GUID from the PDF4me dashboard. Identifies which parse template (capture keys + extraction rules) the module should apply.12345678-1234-1234-1234-123456789abc

解析模板中的表达式类型

正则表达式稳定模式
发票号码(INV-\d{6,10}),日期(\d{2}/\d{2}/\d{4}),金额($?\d{1,3}(?:,\d{3})*(?:.\d{2})?约 80% 的生产捕获密钥。
JavaScript 表达式条件逻辑和分类器
捕获区域文本以如下方式传递: 文本返回一个字符串。支持多标记分类、回退规则和日期规范化。参见 准备文档解析信息 提供两个工作样品。

输出

该模块返回一个 每次执行都附带跟踪标识符以及已解析的键/值数据,准备映射到下一个模块。

场地它包含什么
Trace-IdUnique identifier for the parse operation. Useful for audit logs and error troubleshooting.
Parsed fieldsOne field per capture key defined in the template (for example invoiceNumber, totalAmount, invoiceDate). Pick them directly in the visual mapper of any downstream module.

场景示例

常见制造场景模式Typical ways to chain Parse a Document into a Make flow.
通过电子邮件将发票发送到 Airtable
  1. Gmail 监控邮件会在收到新供应商发票时触发。
  2. 迭代器遍历每个 PDF 依恋。
  3. 解析文档时,会针对二进制附件运行发票模板。
  4. Airtable 创建记录会将 invoiceNumber、totalAmount 和 invoiceDate 写入 AP 表。
将 Dropbox 收据导入 Google Sheets
  1. Dropbox Watch Files 会在 /receipts 目录下有新上传的文件时触发。
  2. Dropbox 下载文件时会加载每个文件。 PDF 二进制。
  3. 解析文档使用收据模板提取供应商、日期、商品、总计。
  4. Google Sheets 的“添加行”功能会将解析后的值添加到费用跟踪器中。
分类器+路由器场景
  1. HTTP Webhook 接收到入站请求 PDF
  2. 解析文档会运行一个带有模板的程序 JavaScript 返回文档类型的表达式键。
  3. 路由根据类型字段(发票/订单/收据)分支到特定类型的下游分支。
  4. 每个分支都会将解析后的值发布到其目标系统。

常见问题解答

What goes in the Template Name field?+
Paste the TemplateId GUID from the PDF4me dashboard. Despite the field label, the GUID is the safer production value. It is stable across renames and identical to the value used by the REST API and the other platform connectors.
Where does the file content come from?+
Any upstream module that returns a binary file works: Dropbox Download a File, Google Drive Get a File, OneDrive Download a File, HTTP Get a File, Gmail Get an Attachment. Map both File Content and File Name from the same upstream step.
Do I have to build a template, or can the module parse any PDF?+
Template-based parsing is the supported production mode. Build the template once in the dashboard, then reference its TemplateId. The same TemplateId also works in n8n, Zapier, Power Automate, and direct REST calls.
Can I classify documents at parse time using JavaScript?+
Yes. Inside the template add a JavaScript Expression on a capture key. The capture area text is passed as the variable text and your function returns a string. Use it for invoice vs order vs receipt classification or to normalize date and amount formats.
Where do the parsed field values show up in the next module?+
In the visual mapper they appear as individual fields on the Parse a Document module output bundle, named to match your template capture keys (camelCase). Pick them like any other Make data mapping.
What if my PDF has multiple layouts (different invoice senders)?+
Use a JavaScript Expression key to detect the layout marker, then build one capture template per layout and select the right TemplateId with a Router. Or use Set Up Classify Document upstream to pre-route, then call Parse a Document with the matching template.

相关行动

在其他平台上执行相同的任务

获取帮助