我有多个 blob,我从中创建 blob url 并使用print-js库显示浏览器的打印预览屏幕。
我有
async printDocuments(): Promise<any> {
const _files: { fileName: string, blob: any }[] = await this._getFiles();
_files.forEach((_fileInfo, index) => {
const blobUrl = URL.createObjectURL(_fileInfo.blob);
printJS(blobUrl);
});
}
但这仅显示第一个文件的打印预览对话框。
如何通过合并或打开多个打印窗口来打印所有文档。
我试过用这个
printJS({
printable: _files[0].blob,
type: "pdf",
onPrintDialogClose: () => {
console.log("nex");
}
});
但现在它显示
core.js:4196 ERROR Error: Uncaught (in promise): TypeError: params.printable.charAt is not a function
TypeError: params.printable.charAt is not a function