Header and Footer creation from html code

Hello,
I am trying to find a solution on how I can create a header and a footer based on html.
The body is already created from the html. That same html contains hidden code for header and footer, where it is stripped and reformatted to be used as header and footer. I am looking into a solution for this through Aspose.Words, but I have not find a possibility as of yet.
I would highly appreciate any and all suggestion in the right direction.

Hi

Thanks for your inquiry. I think, you can just use InseertHtml method:
https://reference.aspose.com/words/net/aspose.words/documentbuilder/inserthtml/
Just move DocumentBuilder cursor into the header or footer using MoveToHeaderFooter method and insert HTML.
https://reference.aspose.com/words/net/aspose.words/documentbuilder/movetoheaderfooter/
Please let me know if you need more assistance, I will be glad to help you.
Best regards.

Thanks,
That did the job so far.
In the footer there is a requirement for pagenumber and nimber of pages. The html contains code %pn%/%pt% which I replaced by { PAGE }/{ NUMPAGES }. Regretfully within the enddocument it states just that instead of getting replaced by its numbers.
If you could tell me howto get about this, I would appreciate it.

Hi there,
You should try using the InsertField method which is detailed here to achieve what you are looking for. There are also a few examples for you to look at on that page.
Thanks,

Thanks again,
I did find out about that of insertfield, however I am unable to get it as replacement from the code within the htrml. After inserthtml it places the insertfield data at least 2 rows down, where as I need to replace the code within the html.
Any suggestions would be appreciated.

Hi Kees,
Thanks for this additional information. I believe you can use the code provided by Alexey regarding a very similar request on this thread here.
If you need any further help please feel free to ask.
Thanks,

The issues you have found earlier (filed as 981) have been fixed in this update.