Need to combine multiple Word files into a single PDF using C#? Wordize for .NET provides all the essential tools for programmatically merging Word files and saving the result in PDF format. This solution excels at automating Word file processing tasks, particularly important when working with large data sets.
The API is designed following C# programming best practices. No external dependencies and seamless integration allow you to quickly implement Word merging functionality into existing .NET projects without architectural changes.
Test the C# API for merging Word into PDF — use the interactive demonstration on this page. Upload several Word files, examine the ready-to-use C# code snippet, perform the Word merging operation, and evaluate the quality of the resulting PDF document.
using Wordize.Merging;
Merger.Merge("Output.pdf",
[
"Input1.docx",
"Input2.docx"
]);
using Wordize.Merging;
Merger.Merge("Output.pdf",
[
"Input1.docx",
"Input2.docx"
]);
using Wordize.Merging;
using Wordize.Saving;
var imageStreams = Merger.MergeToImages(
["Input1.docx", "Input2.docx"],
new ImageSaveOptions(SaveFormat.Pdf) { PageLayout = MultiPageLayout.Vertical(10) },
MergeFormatMode.KeepSourceFormatting
);
using var file = File.Create($"Output.pdf");
imageStreams[0].Position = 0;
imageStreams[0].CopyTo(file);
using Wordize.Merging;
using Wordize.Saving;
ImageSaveOptions saveOptions = new ImageSaveOptions(saveFormat);
saveOptions.PageLayout = MultiPageLayout.Vertical(10);
Merger.Create()
.From("Input1.docx")
.From("Input2.docx")
.To("Output.pdf", saveOptions)
.Execute();
using Wordize.Merging;
Merger.Create()
.From("Input1.docx")
.From("Input2.docx")
.To("Output.pdf", SaveFormat.Pdf)
.Execute();