Hi Team,
i have four documents need to be merged. when i’m merging getting image contents misaligned. how can i resolve it?
image alignment before merging the documents:
image alignment after merging the documents:
sample code and documents attached herepage1.docx (80.6 KB)
page2.docx (73.2 KB)
page3.docx (72.4 KB)
page4.docx (102.1 KB)
string[] fileNames = { "page1.docx", "page2.docx", "page3.docx", "page4.docx" };
var output = new Document();
output.RemoveAllChildren();
ImportFormatOptions importFormatOptions = new ImportFormatOptions();
importFormatOptions.SmartStyleBehavior = true;
importFormatOptions.MergePastedLists = false;
importFormatOptions.ForceCopyStyles = true;
importFormatOptions.IgnoreHeaderFooter = true;
importFormatOptions.IgnoreTextBoxes = false;
foreach (string fileName in fileNames)
{
var input = new Document(fileName);
output.AppendDocument(input, ImportFormatMode.KeepSourceFormatting, importFormatOptions);
}
output.Save("Result.docx");