I'm trying to generate a docx file and download it for the user, using HTML code which contains internal css styling and attributes for HTML tags.
This HTML code is generated using the docx2html package, which allows (as it sounds) us to convert uploaded docx file to HTML, so I want to do the reverse process:
<p><meta charset=utf-8><meta key="generator" value="docx2html">docx file titel
<style type="text/css">#A * { margin: 0px; border: 0px; padding: 0px; box-sizing: border-box; }
#A table { width: 100%; border-collapse: collapse; word-break: break-word; }
#A section { margin: auto; background-color: white; color: black; position: relative; z-index: 0; }
#A p:empty::before { content: ""; display: inline-block; }
#A ul { list-style: none; }
#A ul > li > p { position: relative; }
#A ul .marker { position: absolute; }
#A a { text-decoration: none; }
#A .unsupported { outline: red solid 2px; }
#A .warning { outline: yellow solid 1px; }
#A p, #A h1, #A h2, #A h3, #A h4, #A h5, #A h6 { margin-bottom: 10px; line-height: 107.917%; }
#A span, #A a { font-family: Calibri; font-size: 11px; }
#A .Normal { margin-bottom: 13px; line-height: 115%; }
#A .Normal span { }
#A .Policepardfaut { }
#A .TableauNormal { }
#A .TableauNormal > tbody > tr > td { padding: 0px 7px; }
#A .Default { line-height: 100%; }
#A .Default span { font-family: Calibri; color: rgb(0, 0, 0); font-size: 12px; }
</style>
</p>
<div id="A" style="background-color: transparent; min-height: 1000px; width: 100%; padding-top: 20px; overflow: auto;">
<style type="text/css">
</style>
<section style="width: 793px; min-height: 1122px; padding: 94px; column-gap: 47px;">
<p class="Normal" style="line-height: 100%; text-align: right;"><span class="Policepardfaut" style="font-family: Calibri; font-weight: 700; color: rgb(0, 0, 0); font-size: 14px;">Alger, </span><span class="Policepardfaut" style="font-family: Calibri; font-weight: 700; color: rgb(0, 0, 0); font-size: 14px;">Le </span><span class="Policepardfaut" style="font-family: Calibri; color: rgb(0, 0, 0); font-size: 14px;">25</span><span class="Policepardfaut" style="font-family: Calibri; color: rgb(0, 0, 0); font-size: 14px;">/07/2018</span></p>
</section>
</div>