OfficeDev / Open-Xml-PowerTools

MIT License
692 stars 26 forks source link

How convert to Html with inline style instead of accomulating them into head-style tag? #229

Closed ryzhovalexandr closed 6 years ago

ryzhovalexandr commented 6 years ago

I want to insert converted doc in div part of html page. I don't want to use frames. Is there option to convert doc to html with inline style? for example instead of

<head><style>...</style><head><body><p class="..">..</p></body>

get just

<body><p style=".."><span style=".."></span></p></body>

EricWhiteDev commented 6 years ago

Currently that isn't a feature of the Open-Xml-PowerTools. It would not be too hard, but this isn't implemented. But what you could do is to use the HtmlAgilityPack (or LINQ to XML in combination with HtmlAgilityPack to insert the right elements into your page at the proper place, and to merge the contents of the style element with the style element of the containing page...

ryzhovalexandr commented 6 years ago

@EricWhiteDev thank you

ryzhovalexandr commented 6 years ago

By the way, I've found nice solution with PreMailer.Net