需要将图片存到word中并导出word格式文件,实现方式如下:
1、以下是html代码,将图片转换为base64数据,替换xxxxxx
2、然后将文本存成doc文件,就可以通过word打开了
3、其中图片在word中的尺寸,要像代码中这样写 800和300的设置才可以生效
<html xmlns:o= urn:schemas-microsoft-com:office:office xmlns:w= urn:schemas-microsoft-com:office:word xmlns= http://www.w3.org/TR/REC-html40 >
<div>
<img height="800" width="320" style="width:100%;max-width:100%;height:100%;max-width:100%;" src="data:image/jpeg;base64,xxxxxx">
</div>
</html>
附图片:


感谢文章
http://www.seozhijia.net/html/176.html
https://blog.csdn.net/weixin_43180925/article/details/127005923
© 版权声明
文章版权归作者所有,未经允许请勿转载。如内容涉嫌侵权,请在本页底部进入<联系我们>进行举报投诉!
THE END






















暂无评论内容