In my angular application, I used the below code for convert any file to Base64 string.
handleUpload(event) { const file = event.target.files[0]; const reader = new FileReader(); reader.readAsDataURL(file); reader.onload = () => { console.log(reader.result); }; }
Here, I want to convert the pdf URL to base64 on the fly. Here's my sample URL which I want to convert base64.
https://vadimdez.github.io/ng2-pdf-viewer/assets/pdf-test.pdf
https://stackoverflow.com/questions/66929696/convert-pdf-url-to-base64 April 03, 2021 at 05:45PM
没有评论:
发表评论