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

Free Support Forum - aspose.com

Empty paragraph is added after inserting HTML into header of document using C#

I am building header with html to word. It’s adding extra blank line at the end of the header.
Is there any settings to remove the blank line from the header.


The extra line is empty paragraph. You can remove it using Node.Remove method.

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.


Here are some details about the issue. Decode the string below with Base64 decode that gives html and convert the html below into document header part, which is adding space at the end. The issue because of h1, and p tags but can’t eliminate them. Let me know if there is any solution can that can work without altering the content below.



You can remove the last line of header using the Node.Remove method. Please check the following code example.

var doc = new Document();
var builder = new DocumentBuilder(doc);
doc.Save(MyDir + "20.3.docx");

thanks, Tahir.