Free Support Forum - aspose.cloud

Rich HTML text with headings in Word


#1

Hi

I have a Word template which is used to generate proposals. I have successfully used Aspose. Words Cloud in order to populate simple mustache placeholders in this template.

I’ve also been able to pass in encoded HTML (as per docs) and have this formatted with bold, italics, etc.

What I would like to do is pass in HTML with headings and paragraphs, so that I can import a section of the document into my template. For example, if my html code is < h2 >My heading< /h2 >" Then I’d like that to appear as a Heading 2 in Word, matching the other headings in the template.

When I try this, anything within the < h2 > tags simply does not appear in the document. Other tags, like bold and italic, do work correctly - - - I just can’t get it to display headings.

Is there a way to do this, or any other way or workaround I can use to have headings and paragraphs merged into the document?

Thanks

Tom


#2

@Tomkerswill

Thanks for your inquiry. We have populated HTML heading tags in mustache template and unable to notice any issue. H1 HTML heading is appearing as Heading 1 in word document. Please find sample input,data and output files. Hopefully, it will help you to accomplish the task.
MailMergeTemplateHTML.zip (20.7 KB)

However, if the issue persists then please share your sample input and data file here. We will look into it and will guide you accordingly.