img标签 - Python 模块 mammoth 怎么转换 docx 文件为html并保留图片的宽度和高度属性?
迷茫
迷茫 2017-04-18 09:49:37
0
0
879

mammoth 模块,可以将 docx 文件转为 html,可以清理掉 html 代码中 word 的一些特定格式.也能输出 docx 文件中的图片.
在 windows 的 cmd 下,使用如下命令:
mammoth document.docx --output-dir=output-dir
则在 output-dir 目录下,输出 html 文件和图片文件. 但问题是:
html文件里图片文件的高度和宽度属性都删除掉了,图片元素的代码一般这样:

怎么做才能在html文件中保留图片元素的高度和宽度信息呢?
例如格式这样:

多谢您回复!

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous (0)
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!