Merger.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.
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to merge several PDF document into one document keeping original document layout.
string outputFileName = ArtifactsDir + "Merger.Merge.pdf";
string[] inputFiles = new string[] { MyDir + "Merger.pdf", MyDir + "Merger1.pdf", MyDir + "Merger2.pdf" };
Merger.Merge(outputFileName, inputFiles);
See Also
- class Merger
- namespace Wordize.Merging
- assembly Wordize
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. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to merge several document into one document with specified merge format mode.
string outputFileName = ArtifactsDir + "Merger.Merge.docx";
string[] inputFiles = new string[] { MyDir + "Merger.docx", MyDir + "Merger.doc", MyDir + "Merger.rtf" };
Merger.Merge(outputFileName, inputFiles, SaveFormat.Docx, MergeFormatMode.KeepSourceLayout);
See Also
- enum SaveFormat
- enum MergeFormatMode
- class Merger
- namespace Wordize.Merging
- assembly Wordize
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. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Shows how to merge several document into one document using streams.
Stream[] inputStreams = new Stream[]
{
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.docx")),
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.doc")),
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.rtf"))
};
using (Stream output = File.Create(ArtifactsDir + "Merger.MergeStreams.docx"))
Merger.Merge(output, inputStreams, SaveFormat.Docx);
See Also
- enum SaveFormat
- class Merger
- namespace Wordize.Merging
- assembly Wordize
Merge(Stream, Stream[], SaveFormat, MergeFormatMode)
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,
MergeFormatMode mergeFormatMode)
Parameter | Type | Description |
---|---|---|
outputStream | Stream | The output stream. |
inputStreams | Stream[] | The input streams. |
saveFormat | SaveFormat | The save format. |
mergeFormatMode | MergeFormatMode | Specifies how to merge formatting that clashes. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Shows how to merge several document into one document using streams with specifying merge format mode.
Stream[] inputStreams = new Stream[]
{
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.docx")),
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.doc")),
new MemoryStream(File.ReadAllBytes(MyDir + "Merger.rtf"))
};
using (Stream output = File.Create(ArtifactsDir + "Merger.MergeStreams.Mode.docx"))
Merger.Merge(output, inputStreams, SaveFormat.Docx, MergeFormatMode.MergeFormatting);
See Also
- enum SaveFormat
- enum MergeFormatMode
- class Merger
- namespace Wordize.Merging
- assembly Wordize