我可以在控制台中看到addImage()jspdf 库的函数有9 个参数。我见过人们使用其中的前 5 个,但甚至对它们也不确定。不幸的是,官方网站上没有提供这种方法的文档。此外,相应的 github 问题也已关闭。
从源码中可以找到方法签名如下:
function(imageData, format, x, y, w, h[, alias[, compression[, rotation]]])
Run Code Online (Sandbox Code Playgroud)
imageData 必须:
ImageData对象<img>元素<canvas>元素data uriimageData属性(具有上述数据类型之一)format 必须:
'jpeg', 'jpg', 'png' 如果类型不是,string则脚本的行为就像函数具有以下签名(format现在是第六个参数):
function(imageData, x, y, w, h[, format[, alias[, compression[, rotation]]]])
Run Code Online (Sandbox Code Playgroud)
哪里format会有默认值jpeg
x并且y必须是:
w并且h必须是:
alias (可选)必须是:
undefined或null
在这种情况下,唯一标识符是图像的散列compression (可选)必须是:
compression为NONErotation(可选,仅当imageData是 DOM 元素时才相关)必须是:
angle)x和y)(可选,默认:画布中心)bg) (可选,默认:'white')答案基于此处提供的代码。
如果有任何错误或缺少信息,请随时添加它们:)
| 归档时间: |
|
| 查看次数: |
2424 次 |
| 最近记录: |