CSS not working correctly when converting from html to word/pdf

Hello, I’m having trouble with converting a html document containing some divs with borders. It seems that Aspose is having trouble with applying the css rules when the div contains more than one

-tag. Specifically, it applies margin instead of padding, and several divs with borders collapses into each others.


For example:

padding does not

work here

but here


I have attached a word document generated by aspose that shows the problem. I also attached the c# method used for generating the document. It depends on some other methods to work, but it should be enough to show you how i generate the document

Can you please help me with this?
Hi Lasse,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your Html to Docx using MS Word, you will get the same output.

However, we have logged this problem in our issue tracking system as WORDSNET-14248. We will inform you via this forum thread once there is any update available on this issue.

We apologize for your inconvenience.

Thank you for your reply. I have tried converting the html with Word 2016, and it works as expected there. Padding is applied correctly, and the divs are not combined. However, when converting this HTML with Aspose.Words, the problems occur. I have attached the source html, and results from both Word 2016 and Aspose. Can you confirm that this is a bug in Aspose, or do I need to make som changes to how I’m using Aspose?


Also, is there somewhere I can view the status of the issue you created(WORDSNET-14248)?

Hi Lasse,

Thanks for sharing the detail. Yes, this is a bug in Aspose.Words. We will inform you via this forum thread once this issue is resolved. We apologize for your inconvenience.