Insert Header as a HTML file (Content).

Hello. I am trying to insert header from HTML file.
But I got the content of HTML file with tags inside, it was not a as in webViewer.
I think, that I need specify that I read the html file as HtmlLoadOptions.
For example:

string result = System.Text.Encoding.UTF8.GetString(HTMLfile.html);
HeaderFooter header = new HeaderFooter(document, HeaderFooterType.HeaderDefault, new Paragraph(document, result);
             
foreach (Section s in document.Sections)
{
    s.HeadersFooters.Add(header.Clone(true));
}

Hi John,

Try this:

HeaderFooter header = new HeaderFooter(document, HeaderFooterType.HeaderDefault);
header.Content.LoadText(result, LoadOptions.HtmlDefault);

foreach (Section s in document.Sections)
{
    s.HeadersFooters.Add(header.Clone(true));
}

Does it solve your issue?

Regards,
Mario

Amazing. Works perfectly.