Free Support Forum -

Overwrite inline style of HTML tags while generating documents

Iam using Aspose.Word for JAVA package in our application. From the GUI we would receive a rich text html content, which is getting converted into MS-Word document and PDF document. During this process, i need to overwrite the instyle of some of the HTML tags. I would receive the HTML content with lot of


, tags. But, the tags would have instyle with the STYLE attribute. We are already given with a pre-defined template to generate WORD doc. and PDF doc., So, the content appearing in between the

, and

tags should follow the pre-defined styles. But, we follow different inline styles for the GUI. While, converting the html content received from the GUI int to the document, we need to overwrite the inline styles. Can you please, provide your suggestions or solutions to achieve this?


Thanks for your request. I think, you can use regular expressions to parse your input HTML in order to override inline styles.

Also, you can try using INodeChangingCallback:

Hope this helps.

Best regards,