Merging PDFs combines multiple source documents into one deliverable — contract packets, report bundles, or archives assembled from separate files. The SDK appends whole documents through its editing pipeline, so the sources keep their content, layout, and interactive elements.
Use programmatic merging to:
- Assemble contract or proposal packets from reusable parts.
- Bundle related reports into one distributable file.
- Consolidate scanned batches into a single archive.
Merge documents with the .NET SDK
Open the base document (a Word file here — the SDK converts Office formats transparently), append the second document through a PdfEditor, and export the merged result:
using Nutrient;
try{ using Document document = Document.Open("input.docx"); using PdfEditor editor = PdfEditor.Edit(document);Append the second document
Any open Document can be appended — its pages land after the base document’s:
using Document document2 = Document.Open("input.pdf"); editor.AppendDocument(document2);Save and export the merged result
Apply the edit, then export the combined document to PDF:
editor.Save(); document.ExportAsPdf("output.pdf"); Console.WriteLine("Successfully merged documents");}catch (NutrientException e){ Console.Error.WriteLine($"Error: {e.Message}"); Environment.Exit(1);}Handle errors
Nutrient .NET SDK uses exception handling for errors. The methods in this guide throw a NutrientException if a failure occurs. The using statements release the editor and both documents even when a step fails.
Conclusion
You’ve merged two documents — one of them converted from Word on the fly — into a single PDF.