Merge
Merge(string, string[])
Merges the given input documents into a single output document using specified input and output file names.
public static void Merge(string outputFile, string[] inputFiles)
Parameter | Type | Description |
---|---|---|
outputFile | String | The output file name. |
inputFiles | String[] | The input file names. |
Remarks
By default KeepSourceFormatting is used.
Examples
Shows how to merge documents into a single output document.
//There is a several ways to merge documents:
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SimpleMerge.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveOptions.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveFormat.pdf", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
Document doc = Merger.Merge(new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.DocumentInstance.docx");
See Also
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(string, string[], SaveFormat, MergeFormatMode)
Merges the given input documents into a single output document using specified input output file names and the final document format.
public static void Merge(string outputFile, string[] inputFiles, SaveFormat saveFormat,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputFile | String | The output file name. |
inputFiles | String[] | The input file names. |
saveFormat | SaveFormat | The save format. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge documents into a single output document.
//There is a several ways to merge documents:
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SimpleMerge.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveOptions.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveFormat.pdf", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
Document doc = Merger.Merge(new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.DocumentInstance.docx");
See Also
- enum SaveFormat
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(string, string[], SaveOptions, MergeFormatMode)
Merges the given input documents into a single output document using specified input output file names and save options.
public static void Merge(string outputFile, string[] inputFiles, SaveOptions saveOptions,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputFile | String | The output file name. |
inputFiles | String[] | The input file names. |
saveOptions | SaveOptions | The save options. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge documents into a single output document.
//There is a several ways to merge documents:
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SimpleMerge.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveOptions.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveFormat.pdf", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
Document doc = Merger.Merge(new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.DocumentInstance.docx");
See Also
- class SaveOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(string, string[], LoadOptions[], SaveOptions, MergeFormatMode)
Merges the given input documents into a single output document using specified input output file names and save options.
public static void Merge(string outputFile, string[] inputFiles, LoadOptions[] loadOptions,
SaveOptions saveOptions, MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputFile | String | The output file name. |
inputFiles | String[] | The input file names. |
loadOptions | LoadOptions[] | Load options for the input files. |
saveOptions | SaveOptions | The save options. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
See Also
- class LoadOptions
- class SaveOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(string[], MergeFormatMode)
Merges the given input documents into a single document and returns Document
instance of the final document.
public static Document Merge(string[] inputFiles, MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
inputFiles | String[] | The input file names. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge documents into a single output document.
//There is a several ways to merge documents:
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SimpleMerge.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveOptions.docx", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.SaveFormat.pdf", new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
Document doc = Merger.Merge(new[] { MyDir + "Big document.docx", MyDir + "Tables.docx" }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.DocumentInstance.docx");
See Also
- class Document
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(string[], LoadOptions[], MergeFormatMode)
Merges the given input documents into a single document and returns Document
instance of the final document.
public static Document Merge(string[] inputFiles, LoadOptions[] loadOptions,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
inputFiles | String[] | The input file names. |
loadOptions | LoadOptions[] | Load options for the input files. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
See Also
- class Document
- class LoadOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Document[], MergeFormatMode)
Merges the given input documents into a single document and returns Document
instance of the final document.
public static Document Merge(Document[] inputDocuments, MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
inputDocuments | Document[] | The input documents. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge input documents to a single document instance.
DocumentBuilder firstDoc = new DocumentBuilder();
firstDoc.Font.Size = 16;
firstDoc.Font.Color = Color.Blue;
firstDoc.Write("Hello first word!");
DocumentBuilder secondDoc = new DocumentBuilder();
secondDoc.Write("Hello second word!");
Document mergedDoc = Merger.Merge(new Document[] { firstDoc.Document, secondDoc.Document }, MergeFormatMode.KeepSourceLayout);
Assert.AreEqual("Hello first word!\fHello second word!\f", mergedDoc.GetText());
See Also
- class Document
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Stream, Stream[], SaveFormat)
Merges the given input documents into a single output document using specified input output streams and the final document format.
public static void Merge(Stream outputStream, Stream[] inputStreams, SaveFormat saveFormat)
Parameter | Type | Description |
---|---|---|
outputStream | Stream | The output stream. |
inputStreams | Stream[] | The input streams. |
saveFormat | SaveFormat | The save format. |
Examples
Shows how to merge documents from stream into a single output document.
//There is a several ways to merge documents from stream:
using (FileStream firstStreamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream secondStreamIn = new FileStream(MyDir + "Tables.docx", FileMode.Open, FileAccess.Read))
{
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveOptions.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveFormat.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
Document doc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.DocumentInstance.docx");
}
}
See Also
- enum SaveFormat
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Stream, Stream[], SaveOptions, MergeFormatMode)
Merges the given input documents into a single output document using specified input output streams and save options.
public static void Merge(Stream outputStream, Stream[] inputStreams, SaveOptions saveOptions,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputStream | Stream | The output stream. |
inputStreams | Stream[] | The input streams. |
saveOptions | SaveOptions | The save options. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge documents from stream into a single output document.
//There is a several ways to merge documents from stream:
using (FileStream firstStreamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream secondStreamIn = new FileStream(MyDir + "Tables.docx", FileMode.Open, FileAccess.Read))
{
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveOptions.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveFormat.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
Document doc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.DocumentInstance.docx");
}
}
See Also
- class SaveOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Stream, Stream[], LoadOptions[], SaveOptions, MergeFormatMode)
Merges the given input documents into a single output document using specified input output streams and save options.
public static void Merge(Stream outputStream, Stream[] inputStreams, LoadOptions[] loadOptions,
SaveOptions saveOptions, MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputStream | Stream | The output stream. |
inputStreams | Stream[] | The input streams. |
loadOptions | LoadOptions[] | Load options for the input files. |
saveOptions | SaveOptions | The save options. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
See Also
- class LoadOptions
- class SaveOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Stream[], MergeFormatMode)
Merges the given input documents into a single document and returns Document
instance of the final document.
public static Document Merge(Stream[] inputStreams, MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
inputStreams | Stream[] | The input streams. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Examples
Shows how to merge documents from stream into a single output document.
//There is a several ways to merge documents from stream:
using (FileStream firstStreamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream secondStreamIn = new FileStream(MyDir + "Tables.docx", FileMode.Open, FileAccess.Read))
{
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveOptions.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.SaveFormat.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
Document doc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.DocumentInstance.docx");
}
}
See Also
- class Document
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
Merge(Stream[], LoadOptions[], MergeFormatMode)
Merges the given input documents into a single document and returns Document
instance of the final document.
public static Document Merge(Stream[] inputStreams, LoadOptions[] loadOptions,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
inputStreams | Stream[] | The input streams. |
loadOptions | LoadOptions[] | Load options for the input files. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
See Also
- class Document
- class LoadOptions
- enum MergeFormatMode
- class Merger
- namespace Aspose.Words.LowCode
- assembly Aspose.Words