jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.68k stars 3.38k forks source link

docx writer: document with image cannot be opend by MS Word 2007 #3808

Open dikinova opened 7 years ago

dikinova commented 7 years ago

dikinova@ubuntu:~$ uname -a Linux ubuntu 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

sudo dpkg -i ./pandoc-1.19.2.1-1-amd64.deb

pandoc -t docx -o test.docx example001.html +RTS -M4G

Open file test.docx with Microsoft Word 2007, there is an error "/word/document.xml,line:2,column:1705"

But, if I used pandoc-1.18-1-amd64.deb, then test.docx could be opened without any error.

example001.zip

dikinova commented 7 years ago

test.docx

jgm commented 7 years ago

It would be nice to have a minimal example, and unfortunately I don't have Word 2007 to test with. Can you try using just this simple HTML snippet, instead of your full example001.html? I chose this because the error is referring to the point in the xml file where this image is included.

<img src="http://img.mp.itc.cn/upload/20170720/2bd9c17c6d1149daa9fb746bfd92760b_th.jpg"/>
dikinova commented 7 years ago

I try a simple html file:

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='zh-CN'>
    <head>
    </head><body>
<img src="http://img.mp.itc.cn/upload/20170720/2bd9c17c6d1149daa9fb746bfd92760b_th.jpg"/>
    </body>
</html>

the output file test.docx still cannot be opened by Word2007. The error is at line 2, column 800.

PS, I find the file test.docx can be opened by LibreOffice5 correctly and MS Word 2013 correctly.

test.docx

yale8848 commented 6 years ago

also meet this problem

pandoc.exe 2.1.3 Compiled with pandoc-types 1.17.4.2, texmath 0.10.1.1, skylighting 0.7.0.2

awelormro commented 2 months ago

I'm also meeting this issue

jgm commented 2 months ago

People are still using MS Word 2007?

awelormro commented 2 months ago

Is one of the best choices to apply some changes and macro issues, I truly need to use vba for several reasons, found a way to not bother using the libreoffice terminal converter to convert to 2007 xml and gets the job done, sorry to bother