iOS导出word, 图片尺寸问题(html方式导出)

需要将图片存到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>

附图片:

iOS导出word, 图片尺寸问题(html方式导出)

iOS导出word, 图片尺寸问题(html方式导出)

感谢文章
http://www.seozhijia.net/html/176.html
https://blog.csdn.net/weixin_43180925/article/details/127005923

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容