I have multiple blobs from which i am creating blob urls and using print-js library to show print preview screen of browser.
I have
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);
});
}
but this shows print preview dialog for just first file.
How can I print all the documents either by merging or opening multiple printing windows.
I tried using this
printJS({
printable: _files[0].blob,
type: "pdf",
onPrintDialogClose: () => {
console.log("nex");
}
});
but now it is showing
core.js:4196 ERROR Error: Uncaught (in promise): TypeError: params.printable.charAt is not a function
TypeError: params.printable.charAt is not a function