I trying to convert this html
<p><font color = \"#808080\">SHILPI</p>
to docx using pandoc with this command
pandoc -s -o "test.docx" -t html5 -t docx html_file
But its losing colors, I am getting only text, as far as I know I think html code is correct because when I am using wkhtmltopdf to convert same html to pdf it gives the proper color. What can be the issue ? Thanks in advance.
That's not how Pandoc works, it doesn't understand CSS, only HTML/Markdown. It preserves the content, but not the layout etc, see semantic HTML.
You can, however, use templates to style your output consistently. With Word it's a bit more complicated but you can use the --reference-doc option for mostly the same effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With