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

Free Support Forum - groupdocs.com

How to add header and footer when convert from html to docx and pdf using .net framework C#

Hi everyone,

Please, anybody can help me. I have this basic example and I wolud like to know how to add header an footer (even a watermark or an image) when convert an html file to docx and pdf.

Thanks in advanced!!!

string licensePath = @“C:\Users\soporte\Downloads\GroupDocs.Conversion.Product.Family.lic”;
GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();

        // Load source file HTML for conversion
        var converter = new GroupDocs.Conversion.Converter(@"C:\Users\soporte\Downloads\cmdq.html");
        // Prepare conversion options for target format PDF
        var convertOptions = converter.GetPossibleConversions()["docx"].ConvertOptions;
        // Convert to PDF format
        converter.Convert(@"C:\Users\soporte\Downloads\cmdq.docx", convertOptions);


Please take a look at this documentation article - Add Watermark. Let us know if you still need any further assistance.

Thans for the help. I reviewed documentation, but I didnt find anything about how to add headers and footers. Groupdocs doestn support headers and footers?


API doesn’t support adding header and footer during Conversion process.

Hi @Atir_Tahir,

Thanks for your help. I read documentation and to add watermark I need first to create the document and then add watermark, but I dont find any documentation how to add page number in footer and header. Can you help me please?



We are investigating this scenario. Your investigation ticket ID is WATERMARKNET-1375.


For this purpose, you may need to explore following APIs from our sister company (they allow you to create document/pages):

Please feel free to raise any issues regarding these APIs on Aspose forum.
Once document is created, you can add Watermark using GroupDocs.Watermark API.