Pandoc convert docx to markdown with embedded images

JC- picture JC- · Oct 10, 2016 · Viewed 21.9k times · Source

When converting .docx file to markdown, the embedded image is not extracted from the docx archive, yet the output contains ![](media/image1.png){width="6.291666666666667in" height="3.1083333333333334in"}

Is there a parameter that needs to be set in order to get the embedded pictures extracted?

Answer

mb21 picture mb21 · Oct 10, 2016
pandoc --extract-media ./myMediaFolder input.docx -o output.md

From the manual:

--extract-media=DIR Extract images and other media contained in a docx or epub container to the path DIR, creating it if necessary, and adjust the images references in the document so they point to the extracted files. This option only affects the docx and epub readers.