Skip to main content

Merge Documents - Document Assembly for Make

Merge Documents is a Make module by PDF4me that combines multiple Word (.docx) files into a single document. Use it to assemble reports from department sections, compile proposals, or consolidate contract clauses, with full control over merge order and formatting.

What this module does

PDF4me Merge Documents combines multiple Word documents into a single document within Make scenarios with advanced formatting and compliance options. It supports flexible document ordering with SortPosition, customizable formatting modes (KeepSourceFormatting, KeepDifferentStyles, UseDestinationStyles) per document, compliance level settings (ECMA, Transitional, Strict), and timezone metadata for document tracking, ideal for document assembly, report consolidation, contract compilation, and multi-document packaging workflows.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

How Do I Authenticate My Make Scenario?

To access the PDF4me Web API through Make, every request must include a valid Connection holding your PDF4me API key. This enables secure, authenticated communication between your Make scenario and PDF4me's Word document merging service.

Important Facts You Should Not Miss

SortPosition controls merge order, not array order
Documents merge in ascending SortPosition order regardless of how they appear in the Documents array. The lowest SortPosition becomes the base document that all others are appended to.
Three FormatMode options control style handling
KeepSourceFormatting preserves each document's own styles (default). KeepDifferentStyles keeps distinct styles side by side. UseDestinationStyles forces every document into the base document's style sheet.
Compliance Level affects OOXML output
ECMA, Transitional (default), and Strict map to different Open XML (OOXML) compliance standards defined in ECMA-376. Set Strict if downstream systems require ISO/IEC 29500 Strict-compliant .docx output.
Make PDF4me Merge Documents module configured with a Documents array containing Filename, DocContent, SortPosition, and FormatMode for each document to be combined into one Word file

Build the Documents array with Filename, DocContent, and SortPosition per document. The lowest SortPosition becomes the base document.

What Parameters Does Merge Documents Need?

Required: Documents array must contain at least one entry, and every entry needs Filename, DocContent, and SortPosition.

ParameterRequiredWhat it doesExample
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

Output

FieldTypeWhat it contains
NameStringOutput Word filename, taken from the base document (lowest SortPosition).
Doc DataBufferThe merged Word document containing all input documents combined in SortPosition order.

Typical Setups

Workflow ExamplesCommon Make scenario patterns using Merge Documents.
Monthly department reports → consolidated executive report
  1. A scheduled trigger fires once all department reports are submitted for the month.
  2. A cover page (SortPosition 0) and executive summary (SortPosition 1) are retrieved from a templates folder.
  3. An Iterator loops through each department's report, assigning ascending SortPosition values.
  4. Merge Documents combines all sections with FormatMode set to KeepSourceFormatting, preserving each department's own styling.
  5. The consolidated report is uploaded to an executive reports folder and emailed to leadership.
RFP sections → single proposal submission
  1. A trigger fires when all proposal sections (cover letter, technical approach, pricing, team bios) are marked approved.
  2. Each section is retrieved from its owning team's folder with sequential SortPosition values.
  3. FormatMode is set to UseDestinationStyles so every section adopts the cover letter's formatting for a consistent look.
  4. Merge Documents combines all sections into the final proposal document.
  5. The completed proposal is uploaded to a submissions folder and routed to sales leadership for final review.
Contract clause library → assembled final contract
  1. A trigger fires when negotiated contract terms are finalized and approved.
  2. Standard clauses are retrieved from a clause library (SortPosition 0), custom terms from the negotiation folder (SortPosition 1), schedules (SortPosition 2), and the signature page (SortPosition 3).
  3. FormatMode is set to KeepDifferentStyles so each clause type keeps its own formatting variations.
  4. Merge Documents assembles the components in correct legal order into a single contract.
  5. The final contract is uploaded to an executed-contracts folder and routed to the legal team for review.

Practical Tips

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.

Cheat Sheet

FieldValue
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

Frequently Asked Questions

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.

Industry Use Cases & Applications

  • Contract Assembly: Merge standard clauses with custom terms into complete contracts
  • Legal Brief Compilation: Combine argument sections, exhibits, authorities into final briefs
  • Discovery Document Assembly: Merge privilege logs with responsive documents for production
  • Matter File Consolidation: Combine case memos, pleadings, correspondence into matter summaries
  • Opinion Letter Assembly: Merge research memos with opinion boilerplate into client letters

Same Task on Other Platforms

Get Help