Merge
Merge(string, string[])
يدمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام أسماء ملفات الإدخال المحددة وأسماء ملفات الإخراج باستخدامKeepSourceFormatting .
public static void Merge(string outputFile, string[] inputFiles)
معامل | يكتب | وصف |
---|---|---|
outputFile | String | اسم ملف الإخراج. |
inputFiles | String[] | أسماء ملفات الإدخال. |
ملاحظات
إذا كان تنسيق الإخراج صورة (BMP، EMF، EPS، GIF، JPEG، PNG، أو WebP)، فسيتم حفظ كل صفحة من الإخراج كملف منفصل. سيتم استخدام اسم ملف الإخراج المحدد لإنشاء أسماء ملفات لكل جزء وفقًا للقاعدة: outputFile_partIndex.extension.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات.
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(string, string[], SaveFormat, MergeFormatMode)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام أسماء ملفات الإدخال والإخراج المحددة وتنسيق المستند النهائي.
public static void Merge(string outputFile, string[] inputFiles, SaveFormat saveFormat,
MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
outputFile | String | اسم ملف الإخراج. |
inputFiles | String[] | أسماء ملفات الإدخال. |
saveFormat | SaveFormat | تنسيق الحفظ. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
ملاحظات
إذا كان تنسيق الإخراج صورة (BMP، EMF، EPS، GIF، JPEG، PNG، أو WebP)، فسيتم حفظ كل صفحة من الإخراج كملف منفصل. سيتم استخدام اسم ملف الإخراج المحدد لإنشاء أسماء ملفات لكل جزء وفقًا للقاعدة: outputFile_partIndex.extension.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات.
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- enum SaveFormat
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(string, string[], SaveOptions, MergeFormatMode)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام أسماء ملفات الإدخال والإخراج المحددة وخيارات الحفظ.
public static void Merge(string outputFile, string[] inputFiles, SaveOptions saveOptions,
MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
outputFile | String | اسم ملف الإخراج. |
inputFiles | String[] | أسماء ملفات الإدخال. |
saveOptions | SaveOptions | خيارات الحفظ. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
ملاحظات
إذا كان تنسيق الإخراج صورة (BMP، EMF، EPS، GIF، JPEG، PNG، أو WebP)، فسيتم حفظ كل صفحة من الإخراج كملف منفصل. سيتم استخدام اسم ملف الإخراج المحدد لإنشاء أسماء ملفات لكل جزء وفقًا للقاعدة: outputFile_partIndex.extension.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات.
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- class SaveOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(string, string[], LoadOptions[], SaveOptions, MergeFormatMode)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام أسماء ملفات الإدخال والإخراج المحددة وخيارات الحفظ.
public static void Merge(string outputFile, string[] inputFiles, LoadOptions[] loadOptions,
SaveOptions saveOptions, MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
outputFile | String | اسم ملف الإخراج. |
inputFiles | String[] | أسماء ملفات الإدخال. |
loadOptions | LoadOptions[] | خيارات التحميل لملفات الإدخال. |
saveOptions | SaveOptions | خيارات الحفظ. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
ملاحظات
إذا كان تنسيق الإخراج صورة (BMP، EMF، EPS، GIF، JPEG، PNG، أو WebP)، فسيتم حفظ كل صفحة من الإخراج كملف منفصل. سيتم استخدام اسم ملف الإخراج المحدد لإنشاء أسماء ملفات لكل جزء وفقًا للقاعدة: outputFile_partIndex.extension.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات.
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- class LoadOptions
- class SaveOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(string[], MergeFormatMode)
يدمج مستندات الإدخال المقدمة في مستند واحد ويعيدDocument
مثال على المستند النهائي.
public static Document Merge(string[] inputFiles, MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
inputFiles | String[] | أسماء ملفات الإدخال. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- class Document
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(string[], LoadOptions[], MergeFormatMode)
يدمج مستندات الإدخال المقدمة في مستند واحد ويعيدDocument
مثال على المستند النهائي.
public static Document Merge(string[] inputFiles, LoadOptions[] loadOptions,
MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
inputFiles | String[] | أسماء ملفات الإدخال. |
loadOptions | LoadOptions[] | خيارات التحميل لملفات الإدخال. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
أمثلة
يوضح كيفية دمج المستندات في مستند إخراج واحد.
//هناك عدة طرق لدمج المستندات:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.1.docx", new[] { inputDoc1, inputDoc2 });
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.2.docx", new[] { inputDoc1, inputDoc2 }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.3.pdf", new[] { inputDoc1, inputDoc2 }, SaveFormat.Pdf, MergeFormatMode.KeepSourceLayout);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
Merger.Merge(ArtifactsDir + "LowCode.MergeDocument.4.docx", new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.5.docx");
doc = Merger.Merge(new[] { inputDoc1, inputDoc2 }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
doc.Save(ArtifactsDir + "LowCode.MergeDocument.6.docx");
أنظر أيضا
- class Document
- class LoadOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Document[], MergeFormatMode)
يدمج مستندات الإدخال المقدمة في مستند واحد ويعيدDocument
مثال على المستند النهائي.
public static Document Merge(Document[] inputDocuments, MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
inputDocuments | Document[] | المستندات المدخلة. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
أمثلة
يوضح كيفية دمج مستندات الإدخال في مثيل مستند واحد.
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());
أنظر أيضا
- class Document
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Stream, Stream[], SaveFormat)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام تدفقات الإدخال والإخراج المحددة وتنسيق المستند النهائي.
public static void Merge(Stream outputStream, Stream[] inputStreams, SaveFormat saveFormat)
معامل | يكتب | وصف |
---|---|---|
outputStream | Stream | تيار الإخراج. |
inputStreams | Stream[] | تدفقات الإدخال. |
saveFormat | SaveFormat | تنسيق الحفظ. |
ملاحظات
إذا كان تنسيق الإخراج عبارة عن صورة (BMP، أو EMF، أو EPS، أو GIF، أو JPEG، أو PNG، أو WebP)، فسيتم حفظ الصفحة الأولى فقط من الإخراج في التدفق المحدد.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات إلى الدفق المحدد.
أمثلة
يوضح كيفية دمج المستندات من التدفق إلى مستند إخراج واحد.
//توجد عدة طرق لدمج المستندات من التدفق:
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.1.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.2.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.3.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document firstDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
firstDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.4.docx");
Document secondDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
secondDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.5.docx");
}
}
أنظر أيضا
- enum SaveFormat
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Stream, Stream[], SaveOptions, MergeFormatMode)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام تدفقات الإدخال والإخراج المحددة وخيارات الحفظ.
public static void Merge(Stream outputStream, Stream[] inputStreams, SaveOptions saveOptions,
MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
outputStream | Stream | تيار الإخراج. |
inputStreams | Stream[] | تدفقات الإدخال. |
saveOptions | SaveOptions | خيارات الحفظ. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
ملاحظات
إذا كان تنسيق الإخراج عبارة عن صورة (BMP، أو EMF، أو EPS، أو GIF، أو JPEG، أو PNG، أو WebP)، فسيتم حفظ الصفحة الأولى فقط من الإخراج في التدفق المحدد.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات إلى الدفق المحدد.
أمثلة
يوضح كيفية دمج المستندات من التدفق إلى مستند إخراج واحد.
//توجد عدة طرق لدمج المستندات من التدفق:
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.1.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.2.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.3.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document firstDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
firstDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.4.docx");
Document secondDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
secondDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.5.docx");
}
}
أنظر أيضا
- class SaveOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Stream, Stream[], LoadOptions[], SaveOptions, MergeFormatMode)
دمج مستندات الإدخال المحددة في مستند إخراج واحد باستخدام تدفقات الإدخال والإخراج المحددة وخيارات الحفظ.
public static void Merge(Stream outputStream, Stream[] inputStreams, LoadOptions[] loadOptions,
SaveOptions saveOptions, MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
outputStream | Stream | تيار الإخراج. |
inputStreams | Stream[] | تدفقات الإدخال. |
loadOptions | LoadOptions[] | خيارات التحميل لملفات الإدخال. |
saveOptions | SaveOptions | خيارات الحفظ. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
ملاحظات
إذا كان تنسيق الإخراج عبارة عن صورة (BMP، أو EMF، أو EPS، أو GIF، أو JPEG، أو PNG، أو WebP)، فسيتم حفظ الصفحة الأولى فقط من الإخراج في التدفق المحدد.
إذا كان تنسيق الإخراج هو TIFF، فسيتم حفظ الإخراج كملف TIFF متعدد الإطارات إلى الدفق المحدد.
أمثلة
يوضح كيفية دمج المستندات من التدفق إلى مستند إخراج واحد.
//توجد عدة طرق لدمج المستندات من التدفق:
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.1.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.2.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.3.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document firstDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
firstDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.4.docx");
Document secondDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
secondDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.5.docx");
}
}
أنظر أيضا
- class LoadOptions
- class SaveOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Stream[], MergeFormatMode)
يدمج مستندات الإدخال المقدمة في مستند واحد ويعيدDocument
مثال على المستند النهائي.
public static Document Merge(Stream[] inputStreams, MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
inputStreams | Stream[] | تدفقات الإدخال. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
أمثلة
يوضح كيفية دمج المستندات من التدفق إلى مستند إخراج واحد.
//توجد عدة طرق لدمج المستندات من التدفق:
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.1.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.2.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.3.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document firstDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
firstDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.4.docx");
Document secondDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
secondDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.5.docx");
}
}
أنظر أيضا
- class Document
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words
Merge(Stream[], LoadOptions[], MergeFormatMode)
يدمج مستندات الإدخال المقدمة في مستند واحد ويعيدDocument
مثال على المستند النهائي.
public static Document Merge(Stream[] inputStreams, LoadOptions[] loadOptions,
MergeFormatMode mergeFormatMode)
معامل | يكتب | وصف |
---|---|---|
inputStreams | Stream[] | تدفقات الإدخال. |
loadOptions | LoadOptions[] | خيارات التحميل لملفات الإدخال. |
mergeFormatMode | MergeFormatMode | يحدد كيفية دمج التنسيقات المتعارضة. |
أمثلة
يوضح كيفية دمج المستندات من التدفق إلى مستند إخراج واحد.
//توجد عدة طرق لدمج المستندات من التدفق:
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.1.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, saveOptions, MergeFormatMode.KeepSourceFormatting);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.2.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, SaveFormat.Docx);
LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamDocument.3.docx", FileMode.Create, FileAccess.ReadWrite))
Merger.Merge(streamOut, new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, saveOptions, MergeFormatMode.KeepSourceFormatting);
Document firstDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, MergeFormatMode.MergeFormatting);
firstDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.4.docx");
Document secondDoc = Merger.Merge(new[] { firstStreamIn, secondStreamIn }, new[] { firstLoadOptions, secondLoadOptions }, MergeFormatMode.MergeFormatting);
secondDoc.Save(ArtifactsDir + "LowCode.MergeStreamDocument.5.docx");
}
}
أنظر أيضا
- class Document
- class LoadOptions
- enum MergeFormatMode
- class Merger
- مساحة الاسم Aspose.Words.LowCode
- المجسم Aspose.Words