Why merge different documents?
There are a lot of common yet crucial reasons to merge documents. Let's understand the need with some use-cases.
Real estate
When you buy or lease a property, you have to go through a lot of documentation (e.g. mortgage, loan application, agreements, various expense recordings). Such documentation is mostly recorded in multiple file formats (e.g. PDF, Word, Excel, Presentation). Wouldn't it be super if you could compile all the documents into a single understandable format such as PDF?
Archived documents
Most of the time we have a lot of electronic documents saved in various formats. They all have similar content and need to be combined. For example Excel file with charts, or Word file swith some formatted text. These details could be combined in a single PDF. Eventually, you can share this resultant PDF with colleagues or print it without any issue.
Merge documents to PDF
Let's see how we merge DOC, PPT, XLS and PDF files into a single PDF.
- using (Merger merger = new Merger(@"c:\document1.pdf"))
- {
- merger.Join(@"c:\document2.doc");
- merger.Join(@"c:\document3.ppt");
- merger.Join(@"c:\document4.xls");
- merger.Save(@"c:\merged.pdf");
- }
Download the
DLL and add it as a reference in your .NET project (existing or new). However, in case of any issue, post it
here.