Closed ghost closed 3 years ago
I am unable to get the print dialog popping up and there is no error in the console. I assume it's to do with the blob not being converted properly, but after researching, it looks like I do have all the elements for it to work. Any ideas?
const onPrint = () => { const url = "https://www.homes4u.co.uk/wp-content/uploads/2020/09/3.22-Move-Out-Guide.pdf"; fetch(url) .then((response) => { response.blob(); }) .then((blob) => { let pdfBlob = new Blob([blob], { type: "application/pdf" }); let blobUrl = URL.createObjectURL(pdfBlob); printJS({ printable: blobUrl, type: "pdf", showModal: true, onError: (err) => { console.log(err, "err"); }, }); }) .catch((err) => console.log(err, "err")); };
I am unable to get the print dialog popping up and there is no error in the console. I assume it's to do with the blob not being converted properly, but after researching, it looks like I do have all the elements for it to work. Any ideas?