Hi,
in the attached sample you will see that appending a document to a new document will modify the original layout.
Please take a look,
Greetings
Hi Markus,
lic.SetLicense("Aspose.Words.lic");
var document2 = new Document(@".\Document\test.docx");
Document document1 = (Document)document2.Clone(false);
document1.RemoveAllChildren();
document1.EnsureMinimum();
document1.AppendDocument(document2, ImportFormatMode.KeepDifferentStyles);
var filename = Path.GetTempPath() + Path.GetRandomFileName() + ".docx";
document1.Save(filename);
Console.WriteLine("saved document to : " + filename);
Process.Start(filename);
Console.ReadLine();
Hi Awais,
I think I have to explain a little further. Of course we do not only append one document to an empty document. We merge many different docs. At first to a blank document then to the steadily growing document.
So cloning the document and then stripping it to finally append it to ist former self does not seem to be an useful approach.
Could you revise?
Greetings,
Markus
Hi Markus,
Hi Markus,
var document2 = new Document(MyDir + "test.docx");
document1.CompatibilityOptions.DoNotVertAlignCellWithSp = false;
document1.AppendDocument(document2, ImportFormatMode.KeepDifferentStyles);
document1.Save(MyDir + @"17.2.0-fixed.docx");