java.lang.Object
com.aspose.words.MergeFormatMode
public class MergeFormatMode
Example:
//There is a several ways to merge documents:
Merger.merge(getArtifactsDir() + "LowCode.MergeDocument.SimpleMerge.docx", new String[] { getMyDir() + "Big document.docx", getMyDir() + "Tables.docx" });
OoxmlSaveOptions ooxmlSaveOptions = new OoxmlSaveOptions();
ooxmlSaveOptions.setPassword("Aspose.Words");
Merger.merge(getArtifactsDir() + "LowCode.MergeDocument.SaveOptions.docx", new String[] { getMyDir() + "Big document.docx", getMyDir() + "Tables.docx" }, ooxmlSaveOptions, MergeFormatMode.KEEP_SOURCE_FORMATTING);
Merger.merge(getArtifactsDir() + "LowCode.MergeDocument.SaveFormat.pdf", new String[] { getMyDir() + "Big document.docx", getMyDir() + "Tables.docx" }, SaveFormat.PDF, MergeFormatMode.KEEP_SOURCE_LAYOUT);
Document doc = Merger.merge(new String[] { getMyDir() + "Big document.docx", getMyDir() + "Tables.docx" }, MergeFormatMode.MERGE_FORMATTING);
doc.save(getArtifactsDir() + "LowCode.MergeDocument.DocumentInstance.docx");
| Field Summary | ||
|---|---|---|
static final int | MERGE_FORMATTING | |
| Combine the formatting of the merged documents. | ||
static final int | KEEP_SOURCE_FORMATTING | |
| Means that the source document will retain its original formatting, such as font styles, sizes, colors, indents, and any other formatting elements applied to its content. | ||
static final int | KEEP_SOURCE_LAYOUT | |
| Preserve the layout of the original documents in the final document. | ||
| Field Detail |
|---|
MERGE_FORMATTING = 0 | |
public static final int MERGE_FORMATTING | |
By using this option, Aspose.Words adapts the formatting of the first document to match the structure and appearance of the second document, but keeps some of the original formatting intact. This option is useful when you want to maintain the overall look and feel of the destination document but still retain certain formatting aspects from the original document.
This option does not have any affect when the input and the output formats are PDF.
KEEP_SOURCE_FORMATTING = 1 | |
public static final int KEEP_SOURCE_FORMATTING | |
By using this option, you ensure that the copied content appears as it did in the original source, regardless of the formatting settings of the first document in merge queue.
This option does not have any affect when the input and the output formats are PDF.
KEEP_SOURCE_LAYOUT = 2 | |
public static final int KEEP_SOURCE_LAYOUT | |
In general, it looks like you print out the original documents and manually adhere them together using glue.