I've been banging my head on this one for a few hours, and I'm sure the solution is quite simple, or non-existent.
I'm trying to convert an html file to docx!
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #d0e4fe;
}
h1 {
color: orange;
text-align: center;
}
p {
font-family: "Times New Roman";
font-size: 20px;
}
</style>
</head>
<body>
<h1>My First CSS Example</h1>
<p>This is a paragraph.</p>
</body>
</html>
I can convert it no problem, but I can't get the styles to stick.
pandoc -s myfile.html -o test64.docx
pandoc -s -c myfile.css myfile.html -o test64.docx
Please save me.
Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.
You can use the program pandoc on the SCF Linux and Mac machines (via the terminal window) to convert from formats such as HTML, LaTeX and Markdown to formats such as HTML, LaTeX, Word, OpenOffice, and PDF, among others.
The above answer no longer works. According to the documentation, you now produce the template using:
pandoc --print-default-data-file reference.docx > custom-reference.docx
For the full documentation of how to use the template, go to the documentation and search for "--reference-doc"
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