标签:bsp base64 spl arc pdf ++ bin return last
// 转 file
dataURIToFile(dataURI) { let binStr = atob(dataURI.split(‘,‘)[1]) let len = binStr.length let arr = new Uint8Array(len) for (var i = 0; i < len; i++) { arr[i] = binStr.charCodeAt(i); }
return new File([arr], `xx.pdf`, { type: ‘application/pdf‘, lastModified: new Date() }) }
// 转 blob
dataURIToBolb(dataURI) {
let binStr = atob(dataURI.split(‘,‘)[1])
let len = binStr.length
let arr = new Uint8Array(len)
for (var i = 0; i < len; i++) {
arr[i] = binStr.charCodeAt(i);
}
return new Blob([arr], {
type: ‘application/pdf‘,
})
}
标签:bsp base64 spl arc pdf ++ bin return last
原文地址:https://www.cnblogs.com/weblff/p/14229082.html