扫码关注官方订阅号
我先使用了了html2canvas 把html转为了图片。但是使用jsPDF的addImage 图片只能显示在pdf的第一页。其它地方隐藏不显示。不会自动到第二页。这个怎么破
认证0级讲师
有个addPage的嘛,你图片过大,或者过多,先自己切分一下。不然,你这只在第一页插入了一个超大图片,当然超出就隐藏了。
它还有个是http://rawgit.com/MrRio/jsPDF... 的嘛,我记得是可以直接用的,不用你自己先生成图片。
压缩,先看源码
function jsPDF(orientation, unit, format, compressPdf) { var options = {}; if (typeof orientation === 'object') { options = orientation; orientation = options.orientation; unit = options.unit || unit; format = options.format || format; compressPdf = options.compress || options.compressPdf || compressPdf; } // ...
所以,不压缩可以写在最开始的初始化的options 中或者 文档没说的第4个参数中
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
有个addPage的嘛,你图片过大,或者过多,先自己切分一下。不然,你这只在第一页插入了一个超大图片,当然超出就隐藏了。
它还有个是http://rawgit.com/MrRio/jsPDF... 的嘛,我记得是可以直接用的,不用你自己先生成图片。
压缩,先看源码
所以,不压缩可以写在最开始的初始化的options 中或者 文档没说的第4个参数中