在“生成单个文档”中 Zapier
生成单个文档 是一个 Zapier 采取行动 PDF4me 合并一个单词, HTML邮件合并或使用 Google 文档模板 JSON 或者 XML 收集数据以生成一份完整的文档。用它来转换 CRM 在 Zap 中,可以将记录转换为合同,将订单数据转换为发票,或将表单提交转换为证书。
相关博客文章(2)
此操作的作用
PDF4me 生成单个文档 Zap 中,它接受一个模板文件和一组数据,并返回一个合并后的文档。映射 单词, HTML, PDF邮件合并或谷歌文档 模板,提供数据 行内文本 或 数据文件并选择输出格式。非常适合生成合同、创建发票、签发证书、撰写录用通知书,以及任何无需编写合并代码即可将一条记录转换为一份文档的工作流程。
验证您的身份 API 要求
要访问 PDF4me 网站 API每个请求都必须包含正确的身份验证凭据。连接您的 PDF4me 账户只需登录一次 Zapier Zap 中的每个“生成单个文档”步骤都会重复使用它。
您不容错过的重要事实
输入数据格式类型决定了哪些数据字段是必需的。
将其设置为
文本 和 数据文本 成为内联的必填字段 JSON/XML将其设置为 文件 和 数据文件 如果数据文件是从上一步映射而来,则该字段变为必填项。另一个字段将保持隐藏状态,直到您切换开关为止。模板文件类型不限于 Word/HTML/PDF
下拉菜单还包括
邮件合并 (一个为邮件合并字段而构建的 Word 模板) Google Docs (使用 Google Docs 导出文件作为合并模板),已在实际 Zap 配置中确认。请将此值与模板文件的实际构建方式进行匹配。运行两次,得到两种输出格式。
一个模板可以为两个不同的“生成单个文档”步骤提供不同的支持。 输出文档类型 数值(例如)
PDF 然后 Docx) 通过单个触发器生成锁定副本和可编辑副本。.png)
设置操作面板,并将“输入数据格式类型”设置为“文本”,从而显示“数据文本”字段。
参数
必需 Zapier 用户界面: 模板文件、模板文件类型、输入数据格式类型、输入数据类型,以及(取决于输入数据格式类型)数据文本或数据文件。模板文件名、输出文档类型、是否保留 PDF 可编辑以及元数据均为可选。
| 范围 | 必需的 | 它的作用 | 例子 |
|---|---|---|---|
| Template File | Required | Template file to populate. Map it from a previous step (Dropbox, Google Drive, Upload File). | template.docx |
| Template File Name | Optional | Name for the output file. If left blank, the name is picked from Template File's own filename. | contract_template |
| Template File Type | Required | Format of the template: Word, HTML, PDF, Mail Merge (Word built for mail-merge fields), or GoogleDocs (Google Docs export). | Mail Merge |
| Input Data Format Type | Required | Whether data is supplied as inline text or a file. Text reveals Data Text. File reveals Data File. | Text |
| Data Text | Conditional | Inline JSON or XML string to merge into the template. Required when Input Data Format Type is Text. | [{"firstname":"John","lastname":"Adams"}] |
| Data File | Conditional | Data file (JSON or XML) mapped from a previous step. Required when Input Data Format Type is File. | data.json |
| Input Data Type | Required | Structure of the supplied data, must match Data Text or Data File exactly. | Json |
| Output Document Type | Optional | Format of the generated document: Pdf, Docx, and other supported formats. | Pdf |
| Keep Pdf Editable | Optional | When the output is a PDF from a fillable template, keeps its form fields interactive instead of flattening them. | false |
| Meta Data | Optional | Metadata to attach to template fields during generation. | - |
输出
| 场地 | 类型 | 它包含什么 |
|---|---|---|
File Name | String | File name of the generated document, without extension. |
File Extension | String | Extension of the output document, matching Output Document Type. |
Full File Name | String | Complete filename including extension. |
File URL | String | Direct URL to the generated document, map this into an Upload File, email, or storage step. |
File Size | Number | Size of the generated document in bytes. |
如何在“生成单个文档”中设置 Zapier?
- 添加 PDF4me 选择 Zap 中的操作应用程序并进行选择 生成文档。
- 连接您的 PDF4me 创建一个帐户或选择现有连接。
- 地图 模板文件 从上一步开始并设置 模板文件类型 为了匹配它(Word, HTML, PDF(例如邮件合并或 Google 文档)。
- 放 输入数据格式类型 到 文本 并填充 数据文本 内联 JSON/XML或者将其设置为 文件 和地图 数据文件 从上一步开始。
- 放 输入数据类型 到 JSON 或者 XML 与您的数据实际格式相匹配。
- (可选) 输出文档类型 和 保持PDF可编辑然后测试该步骤。
- 映射返回结果 文件 URL 将生成的文档上传到 Gmail 或存储操作中以进行交付。
典型配置
工作流程示例Common Zapier patterns using Generate Document Single.
邮件合并模板 JSON 数据文件
- 一个新文件(Word 模板)被放入受监控的 Dropbox 文件夹中。
- “查找文件”步骤会找到匹配的文件。 JSON 数据文件位于同一文件夹中。
- 使用模板文件类型“邮件合并”生成单次文档,输入数据格式类型“文件”,数据文件来自查找步骤,输入数据类型“Json”。
- “上传文件”步骤会将生成的文档保存回 Dropbox。
Google 文档模板,内嵌式 JSON双输出
- “查找文件”步骤会找到导出为 .docx 格式的 Google 文档模板。
- 使用模板文件类型 Google Docs、输入数据格式类型文本、数据文本作为内联方式生成单次文档。 JSON 数组,输出文档类型为Pdf。
- 第二个“生成单个文档”步骤重用相同的模板,输入数据格式类型为“文件”,输出文档类型为“docx”,生成一个可编辑的副本以及一个可编辑的副本。 PDF。
CRM 由 webhook 触发的记录到合同的转换。
- Webhooks Zapier 触发器从……接收来自……的新交易有效载荷 CRM。
- 格式化步骤将有效载荷格式化为所需格式。 JSON 合同模板要求的结构。
- 生成文档单次运行,模板文件类型为 Word,输入数据格式类型为文本,格式化步骤中的数据文本,输入数据类型为 Json,输出文档类型为 Pdf。
- Gmail 步骤会将生成的合同通过电子邮件发送给客户。
HTML 轻量级证书模板
- 课程完成触发事件由学习管理 webhook 发出。
- 使用模板文件类型生成单次运行的文档 HTML输入数据格式类型为文本,数据文本包含学习者姓名、课程和日期,输出文档类型为PDF。
- “上传文件”步骤会将证书保存到学员共享的驱动器文件夹中。
实用技巧
Match Template File Type to how the template was built
Word for a plain merge-field .docx, Mail Merge for a template designed around the mail-merge field pattern, GoogleDocs for a Google Docs export. Picking the wrong type can leave placeholders unfilled.
Toggle Input Data Format Type before filling in data
Data Text and Data File are mutually exclusive: only the field matching your Input Data Format Type selection is required. The other stays out of the way.
Input Data Type must match your data exactly
Json for JSON data, Xml for XML data. A mismatch causes template fields to bind incorrectly or come back empty.
Run twice for two formats from one template
Set Output Document Type to Pdf in one step and Docx in a second step using the same template and data to get both a locked and an editable copy.
Use Keep Pdf Editable only for fillable-PDF templates
This toggle only matters when the template is itself a fillable PDF and the output is Pdf. It has no effect on Word, HTML, or Mail Merge templates.
Batch runs need Generate Documents Multiple, not this action
This action produces one document per run. To generate many personalized documents from one template and a list of records in a single step, use Generate Documents Multiple instead.
速查表
| 场地 | 价值 |
|---|---|
| Action | Generate Document |
| Template File | From a previous step |
| Template File Type | Word / HTML / PDF / Mail Merge / GoogleDocs |
| Input Data Format Type | Text or File |
| Data Text | Required when Input Data Format Type is Text |
| Data File | Required when Input Data Format Type is File |
| Input Data Type | Json or Xml |
| Output Document Type | Pdf, Docx, and other supported formats |
| Keep Pdf Editable | false (default behavior in documented workflows) |
我应该使用什么来代替“生成单个文档”?
如果您的工作流程需要从同一个模板生成多个个性化文档,并在一次运行中生成记录列表,而不是每次 Zap 运行生成一个文档,请使用 生成多个文档如果您的模板是可填写的 PDF 使用表单而不是 Mustache/合并字段模板。 填写 PDF 形式 直接填充其 AcroForm 字段,而不是通过模板引擎运行。
常见问题
相关操作
生成多个文档
使用一个模板和一系列记录,一次性生成多个个性化文档,而不是每次 Zap 运行生成一个文档。
填写PDF表格
如果您的模板是可填写的 AcroForm 表单 PDF 与其使用 mustache/合并字段模板,不如直接填充其字段,而不是通过模板引擎运行。
合并文档
将此处生成的文档与其他文件合并成一个输出文件,方便将求职信和生成的合同整合在一起。 PDF。
在其他平台上执行相同任务
在 Make 中生成单个文档
与 Make 模块相同的模板合并操作,适用于带有云存储触发器的可视化场景。
在 n8n 中生成文档(单个)
等效 n8n 节点,直接连接到自托管或云端 n8n 工作流程。
在 Power Automate 中生成单个文档
Microsoft 365 与……流动 SharePoint, Outlook团队和 Dataverse 触发器。
生成文档单个 REST API
原始 PDF4me API 用于自定义后端代码或 Postman 测试的端点。
行业应用案例及应用
- Legal & Professional Services
- Finance & Accounting
- Human Resources
- Education & Training
- 合同生成:根据客户数据,从模板创建个性化合同
- 法律文件创建生成包含案件特定信息的法律文件
- 协议处理利用动态数据集成实现协议自动创建
- 文档自动化利用模板处理简化法律文件工作流程
- 发票生成使用包含交易数据的模板创建专业发票
- 财务报告利用自动化数据生成财务报表和报告
- 报表生成创建包含客户特定信息的账户报表
- 账单文件利用服务数据自动创建账单文档
- 录用通知书利用候选人数据,根据模板生成个性化录用通知书
- 员工文件利用公司数据创建员工手册和政策
- 证书生成生成培训证书和成绩单
- 入职材料为新员工创建个性化的入职文件
- 证书签发:生成包含学生成绩数据的证书
- 成绩单:创建包含学业成绩数据的个性化成绩单
- 课程资料利用学生信息生成定制课程材料
- 评估文件创建个性化评估文件和反馈