Use pandoc to insert images into a docx file that are in HTML

Is it possible to embed images in a docx file embedded in an HTML file?

I am trying and not working for me, and maybe I am not adding an extra parameter when I run pandoc.

pandoc -f html -t docx -o testdoc.docx image.html

Many thanks!

+4
source share
1 answer

I managed to solve this by running the following command:

pandoc -s file_name.html -o file_name.docx;

There are actually 2 important ponics you need to consider:

  • , pandoc HTML , , , , , <hr/> pandoc, <p>.
  • HTTP-, , :

:

<img src="http://www.example.com/images/img.jpg" />

, pandoc :

<img src="/var/www/example.com/images/img.jpg" />

+2

Source: https://habr.com/ru/post/1525044/


All Articles