Free Support Forum - aspose.com

Saving with Aspose.Words from docx to html does not contain header picture

Dear Aspose team,

we have a .docx file which contains a header image. Loading this file with Aspose.Words 18.10 and saving it as a html will result in a document missing the header picture. With Aspose.Words 18.5 resulted in a html containing the image.

Used code:

Directory.CreateDirectory(resaveFolderName);
Directory.CreateDirectory(resaveFolderName + @"" + “files”);

HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ImagesFolder = resaveFolderName + @"" + “files”;
options.ImagesFolderAlias = “files”;
options.ExportHeadersFootersMode = ExportHeadersFootersMode.FirstSectionHeaderLastSectionFooter;

AsposeLicenseInit.AssureWordsLicenseSet();
Aspose.Words.Document doc = new Aspose.Words.Document(“test.docx”); // update
doc.Save(resaveFolderName + @"" + “test.html”, saveOptions);

Could you check this issue, please?

Best regards,

Gergely Vándor
[BUG-722]

@gergelyv,

Please ZIP and attach your input Word document and Aspose.Words generated output HTML file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

test.zip (217.6 KB)

Forgot to attach the ZIP, sorry about that.

Best regards,

Gergely Vándor

@gergelyv,

You can workaround this issue by using the following code:

options.ExportHeadersFootersMode = ExportHeadersFootersMode.FirstPageHeaderFooterPerSection;