Here are the key reasons to use the new updated API provided by GroupDocs.Merger for .NET since version 19.9:
Merger class introduced as a single entry point to manage the document processing of any supported file format (instead of DocumentHander class from previous versions).
Product architecture was redesigned from scratch in order to decreased memory usage (from 10% to 400% approx. depending on document type).
Document processing API simplified and improved so it’s easy to instantiate proper options class and control over document structure manipulation processes.
How To Migrate?
Here is a brief comparison of how to join documents using old and new API.
Old coding style
stringsourceFile1=CommonUtilities.fileOne+fileOne;stringsourceFile2=CommonUtilities.fileTwo+fileTwo;// Preparing.stringpassword="SomePasswordString";StreamopenFile1=newFileStream(sourceFile1,FileMode.Open);StreamopenFile2=newFileStream(sourceFile2,FileMode.Open);List<JoinItem>documentStreams=newList<JoinItem>();JoinItemitem1=newJoinItem(openFile1,FileFormat.Docx,password);documentStreams.Add(item1);JoinItemitem2=newJoinItem(openFile2,FileFormat.Docx,password);documentStreams.Add(item2);// Main method.DocumentResultresult=newDocumentHandler().Join(documentStreams);StreamdocumentStream=result.Stream;varfileStream=File.Create(CommonUtilities.outputPath+"OutPut."+FileFormat.Docx);documentStream.CopyTo(fileStream);documentStream.Close();