我正在使用jsPDF(),我想要呈现一个文档,我有一个值BASE64,现在我想做一个BLOB并返回到普通视图,我该如何使用JSPDF来做到这一点呢?
这就是密码
const print = () => {
const myFont = "";
var doc = new jsPDF();
doc.text(20, 20, "Name " );
doc.addFileToVFS("MyFont.ttf", myFont);
doc.addFont("MyFont.ttf", "MyFont", "normal");
doc.output("dataurlnewwindow");
};
我不知道如何添加所需的行
发布于 2021-10-19 06:47:54
var blobPDF = new Blob([ doc.output() ], { type : 'application/pdf'});
var blobUrl = URL.createObjectURL(blobPDF); //<--- THE ERROR APPEARS HERE
window.open(blobUrl); // will open a new tab
//window.open(blobUrl,'_system','location=yes'); will open a new window这对我很有效。
https://stackoverflow.com/questions/68703963
复制相似问题