pandoc convert html with style sheet to docx

后端 未结 2 1063
北荒
北荒 2021-02-08 08:16

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!

<
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 08:46

    In your command the "-c myfile.css" would only be used if you were writing to HTML or HTML 5. It is a writer specific option.

    For docx formatting you need to create a ".docx" template.

    Start by running pandoc -D docx > my_template.docx and then edit the styles in my_template.docx.

    Finally run pandoc -s myfile.html --template=my_template -o test64.docx

提交回复
热议问题