跳到主要内容

合并文档 - 文档组装 Make

合并文档 是一个 Make 模块 PDF4me 它可以将多个 Word (.docx) 文件合并成一个文档。您可以使用它来汇总部门报告、编写提案或合并合同条款,并完全控制合并顺序和格式。

本模块的功能

PDF4me 合并文档 将多个 Word 文档合并成一个文档。 Make 它支持具有高级格式和合规性选项的各种场景,并支持灵活的文档排序。 SortPosition可自定义的格式化模式(KeepSourceFormattingKeepDifferentStylesUseDestinationStyles)每个文档,合规级别设置(ECMA(过渡、严格)和时区元数据,用于文档跟踪,非常适合文档组装、报告合并、合同编制和多文档打包工作流程。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

我如何验证我的身份 Make 设想?

要访问 PDF4me 网站 API 通过 Make每个请求都必须包含一个有效的 联系 握着你的 PDF4me API 密钥。这实现了您与他人之间安全、经过身份验证的通信。 Make 场景和 PDF4meWord文档合并服务。

您不容错过的重要事实

SortPosition 控制合并顺序,而非数组顺序
文件按升序合并 SortPosition 无论它们在 Documents 数组中的显示顺序如何,都按此顺序排列。最低 SortPosition 成为所有其他文档附加到的基础文档。
FormatMode 选项控制样式处理
KeepSourceFormatting 保留每个文档自身的样式(默认)。 KeepDifferentStyles 保持不同风格的并排摆放。 UseDestinationStyles 强制所有文档都使用基础文档的样式表。
合规级别的影响 OOXML 输出
ECMA过渡模式(默认)和严格模式分别映射到不同的 打开 XMLOOXML 合规标准定义 ECMA-376如果下游系统需要符合 ISO/IEC 29500 Strict 标准的 .docx 输出,请设置 Strict。
配置 PDF4me 的“合并文档”模块,使其包含一个 Documents 数组,该数组包含要合并到单个 Word 文件中的每个文档的文件名、文档内容、排序位置和格式模式。

使用文件名构建 Documents 数组, DocContent, 和 SortPosition 每份文件。最低 SortPosition 成为基础文档。

合并文档需要哪些参数?

必需的: Documents 数组必须至少包含一个条目,并且每个条目都需要 Filename、DocContent 和 SortPosition。

范围必需的它的作用例子
DocumentsRequiredArray of document objects to merge. Must contain at least one document. Documents are merged in ascending SortPosition order; the lowest SortPosition becomes the base document.[{"Filename":"doc1.docx","SortPosition":0}]
Documents[].FilenameRequiredOriginal filename of the document, including extension (.docx, .doc). Used for reference and format detection.document1.docx
Documents[].DocContentRequiredBase64-encoded binary content of the document. Map from a previous module. Must be a valid Word format.[Buffer]
Documents[].SortPositionRequiredPosition in merge order, ascending. Must be unique within the array. Any numbering scheme works (0,1,2 or 10,20,30).0
Documents[].FormatModeConditionalPer-document formatting mode: KeepSourceFormatting (default, preserves original), KeepDifferentStyles (keeps styles distinct), or UseDestinationStyles (forces base document styling).KeepSourceFormatting
Merge Options Time ZoneConditionalTimezone metadata written to the merged document, e.g. UTC, America/New_York, Europe/London. Used for tracking and compliance.UTC
Merge Options Compliance LevelConditionalOOXML compliance standard: ECMA, Transitional (default), Strict, or Custom.Transitional

输出

场地类型它包含什么
NameStringOutput Word filename, taken from the base document (lowest SortPosition).
Doc DataBufferThe merged Word document containing all input documents combined in SortPosition order.

典型配置

工作流程示例Common Make scenario patterns using Merge Documents.
部门月度报告 → 综合执行报告
  1. 当所有部门当月的报告都提交完毕后,预定的触发器就会触发。
  2. 封面页(SortPosition 0)和执行摘要(SortPosition 1) 从模板文件夹中检索。
  3. 迭代器遍历每个部门的报告,并按升序分配 SortPosition 价值观。
  4. 合并文档将所有部分合并在一起 FormatMode 设置为 KeepSourceFormatting保留各部门自身的风格。
  5. 汇总报告将上传至高管报告文件夹,并通过电子邮件发送给领导层。
RFP 各部分 → 单一提案提交
  1. 当提案的所有部分(求职信、技术方案、定价、团队简介)都被标记为已批准时,触发器就会触发。
  2. 每个部分都按顺序从其所属团队的文件夹中检索。 SortPosition 价值观。
  3. FormatMode 设置为 UseDestinationStyles 因此,每个部分都采用求职信的格式,以保持一致的外观。
  4. 合并文档会将所有部分合并到最终提案文档中。
  5. 完成的提案将上传到提交文件夹,并送交销售领导层进行最终审核。
合同条款库 → 最终合同汇编
  1. 当协商的合同条款最终确定并获得批准后,触发器就会启动。
  2. 标准子句是从子句库中检索的(SortPosition 0),来自谈判文件夹的自定义条款(SortPosition 1),日程安排(SortPosition 2),以及签名页(SortPosition 3)。
  3. FormatMode 设置为 KeepDifferentStyles 因此,每种子句类型都有其自身的格式变体。
  4. 合并文档功能会将各个组成部分按照正确的法律顺序组合成一份合同。
  5. 最终合同将上传至已执行合同文件夹,并送交法务团队审核。

实用技巧

SortPosition values must be unique
Two documents sharing the same SortPosition produces unpredictable ordering. Use gapped numbering (0, 10, 20) so you can insert a new section later without renumbering the whole array.
FormatMode is set per document, not globally
Each entry in the Documents array can use a different FormatMode. Mixing KeepSourceFormatting on most documents with UseDestinationStyles on one is valid if that is the behavior you want.
DocContent must be valid Word binary
Passing a PDF or plain-text buffer into DocContent fails the merge. Confirm the upstream module (OneDrive, SharePoint, Google Drive) is outputting .docx or .doc binary content, not a converted format.
The base document sets the output filename
The Name field in the output always comes from the document with the lowest SortPosition. Rename that document upstream if you need a specific output filename.
Strict compliance can reject legacy .doc content
If Merge Options Compliance Level is set to Strict and a source document uses older .doc-era formatting quirks, some elements may not carry over cleanly. Use Transitional (the default) unless a downstream system specifically requires Strict OOXML.
Large document counts increase processing time
Merging many documents, or documents with heavy embedded media, takes longer than a two-document merge. Test with your actual document set before relying on tight scenario timeouts.

速查表

场地价值
ModuleMerge Documents
ConnectionPDF4me API key
Documents arrayOne entry per file: Filename, DocContent, SortPosition
FormatMode (preserve each doc)KeepSourceFormatting
FormatMode (single consistent look)UseDestinationStyles
FormatMode (keep styles distinct)KeepDifferentStyles
Compliance Level defaultTransitional
Output fieldsName, Doc Data

常见问题解答

How do I merge Word documents without losing formatting?+
Set FormatMode to KeepSourceFormatting on each document in the Documents array. This preserves each document's original styles instead of forcing them into the base document's style sheet. If you want one consistent look instead, use UseDestinationStyles so every document adopts the base document's formatting.
What is the difference between Merge Documents and Mail Merge?+
Merge Documents combines multiple existing Word files into a single file, useful for assembling reports, proposals, or contracts from separate sections. Mail Merge instead takes one template document and a data source like a spreadsheet and generates many personalized copies, one per row. Use Merge Documents when you have several finished documents to combine; use Mail Merge when you have one template and a list of recipients.
Can I control the order documents are merged in?+
Yes. Every document object in the Documents array requires a SortPosition. Make merges documents in ascending SortPosition order, and the document with the lowest SortPosition becomes the base document. SortPosition values do not need to be sequential: 0, 10, 20 works as well as 0, 1, 2, which makes it easy to insert a section later without renumbering everything.
Does merging affect document metadata and custom properties?+
The merged output inherits its Name from the base document (lowest SortPosition). Merge Options Time Zone lets you attach timezone metadata to the merged file for tracking and compliance purposes. Other custom document properties from non-base documents are not automatically carried forward, so re-apply any metadata you need on the merged output if it must match a specific document.
What Word formats does Merge Documents accept?+
The module accepts standard .docx and legacy .doc binary content in the DocContent field. All documents in the Documents array should be genuine Word binaries mapped from a previous module (SharePoint, OneDrive, Google Drive, or similar); passing a PDF or plain-text buffer will fail the merge.

行业应用案例及应用

  • 合同组装将标准条款与自定义条款合并成完整的合同
  • 法律简报汇编:将论点、证据和权威案例合并成最终的辩护状
  • 发现文件汇编将权限日志与生产环境中的响应式文档合并
  • 案件档案合并将案件备忘录、诉状和信函合并成案件摘要
  • 意见书汇编将研究备忘录与意见模板合并到客户信函中。

相关操作

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

获取帮助