12/11/2023 0 Comments Pdfkit browser![]() Is there some way to get this to display correctly? Even better would be if I could just have a download link and not even show it. ![]() The normal way it seems to render the pdf is simply just saying iframe.src = stream.toBlobURL('application/pdf')īut iframe is not defined in wix which is why I just tried setting the entire window.src but that doesn’t work either. ![]() When I attach the blob URL to the download button it appears in the frame and I see all the standard pdf functions such as search, download, print etc… they all work except download which I get a network failed error. The stream.toBlobURL(‘application/pdf’) works completely I think. The issue I have is rendering and downloading the pdf. It is quite difficult to just add an image using the browser version of pdfkit but that isn’t a wix question. Ignore all the document stuff, it is working, although not as cleanly as I would like. Window.src = stream.toBlobURL('application/pdf') window.open(stream.toBlobURL('application/pdf'), '_blank') Var canvas = document.createElement('canvas') Ĭanvas.width = this.naturalWidth // or 'width' if you want a special/scaled sizeĬanvas.height = this.naturalHeight // or 'height' if you want a special/scaled sizeĬanvas.getContext('2d').drawImage(this, 0, 0) ![]() I have gotten pdfkit mostly working and am able to generate a blobstream that I can display on a click. I have seen a number of posts on this but most were just asking how to use it but didn’t get any feedback. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |