We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Content of header and footer are changed after joining documents using .NET


We are using the Aspose word version to generate word documents from HTML. Now, we want to migrate to the latest version We are facing two issues which are described below, both of them are producible in the version and

Scenario 1, in our template both header and footer are defined. Both header and footer values are displayed only on the first page of the generated word document but are not displayed from the second page and so on.

Scenario 2, in our template when header and footer are defined; the first page of the generated document is empty.

File “Template.dotx” and file “Sample Html for issue.html” can be used to generate the word document. File “Word Document.docx” is the generated output word file. The same HTML and template can be used to produce both scenarios.

We are using the following code:
Document htmlDoc = new Document(htmlFilePath, new Aspose.Words.HtmlLoadOptions() { LoadFormat = LoadFormat.Html, Encoding =

Encoding.UTF8 });
Document templateDocument = new Document(templatePath);
templateDocument.AppendDocument(htmlDoc, ImportFormatMode.UseDestinationStyles);
SaveOutputParameters param = templateDocument.Save(docxFilePath);

Please look into this issue and let us know if any other help is required from our side.

Issue data.zip (42.4 KB)

Asif Sharif


You are facing this issue because you are using Aspose.Words for .NET 20.6 in evaluation mode. Please get the temporary license and apply it before importing document into Aspose.Words’ DOM.

We have attached the output document with this post for your kind reference. 20.6.zip (13.6 KB)