Attachment: DOCX to HTML Fixed Conversion.zip (52.1 KB).there are some other options too in HtmlFixedSaveOptions classĭoc.Save("C:\\Temp\\Sample_Doc\\21.5.html", HtmlFixedSaveOptions) HtmlFixedSaveOptions.ExportEmbeddedCss = true
![word document missing header word document missing header](https://www.tech-recipes.com/wp-content/uploads/6-22-2011-5-12-33-PM-300x208.png)
HtmlFixedSaveOptions HtmlFixedSaveOptions = new HtmlFixedSaveOptions() So, if you want to preserve header/footer across all pages in Word document, then you can try saving to HtmlFixed format as follows: Document doc = new Document("C:\\Temp\\Sample_Doc\\Sample_doc.docx") Header for the first page of the section.įooter for the first page of the section. Primary footer, also used for odd numbered pages. Primary header, also used for odd numbered pages. I am attaching the sample doc as well as html file.Ĭonverted_Sample_doc_to_html.zip (15.9 KB) Using (StreamReader reader = new StreamReader((MyDir + dynamichtmlfile))) String dynamichtmlfile = "dynamicfile_" + Guid.NewGuid() + ".html" ĭoc.Save((MyDir + dynamichtmlfile), saveOptions) SaveOptions.ExportHeadersFootersMode = .FirstSectionHeaderLastSectionFooter SaveOptions.CssStyleSheetType = CssStyleSheetType.Embedded
![word document missing header word document missing header](https://www.tech-recipes.com/wp-content/uploads/6-22-2011-5-12-33-PM.png)
HtmlSaveOptions saveOptions = new HtmlSaveOptions() Here I used the below code: lic = new () ĭocument doc = new Document((MyDir + filename)) I am facing issue with header and footer for each section while converting word document to html.