Pass the base64 data to the function base64ToArrayBuffer, You need some kind of JavaScript PDF library to do this. In this tutorial, we will encode files like pdf to base64 format in React. function downloadPDF (pdf) { const linkSource = `data:application/pdf;base64,$ {pdf}`; const downloadLink = document.createElement ("a"); const fileName = "abc.pdf"; downloadLink.href = linkSource; downloadLink.download = fileName; downloadLink.click ();} You can use this function found at https://gist.github.com/1032746. http://mozilla.github.com/pdf.js/build/pdf.js. Thank you. That will be very helpful for me. If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. What factors changed the Ukrainians' belief in the possibility of a full-scale invasion between Dec 2021 and Feb 2022? For example, your browser will not display the PDF file on this page if: Good work for developer community. Of course, spammers are welcome only as readers. Just use your browser. Use the Image () Constructor and the src Property to Convert Base64 to Image in JavaScript Here, we will add the base64 string to the function getBase64Img (). By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. We care about your privacy and your files. , for me it works better to receive base 64 to generate pdf. Works great. To learn more, see our tips on writing great answers. How do I correctly clone a JavaScript object? I haven't got a solution to this issue yet. This class can handle encoding/decoding base64 for us. I also tried this on another website and i get the 502 Bad Gateway error. How can the mass of an unstable composite particle become complex? Help please. @YunusSaha Base64. It starts like this: Click inside the file drop area to upload Base64 files or drag & drop Base64 files. Convert PDF file into Base64 string with JavaScript. First, you need to add a file for conversion: drag & drop or click inside the white area. I made a pipe to put a blank pdf while the one requested is downloaded. About PDF Name: Portable Document Format Click on Convert button. I have tried several conversions (see example below), but none of them result in a working base64 string that can be displayed. Sort array of objects by string property value. We delete uploaded files after 24 hours and the download links will stop working after this time period. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Does anybody know how I can get this string? Sir, I want to know that what is the largest size of PDF can converted into base64 , or if you have any supporting article blog anything to help me with that. Our PDF to Base64 conversion tool is easy to use: select the desired file type, then define the output format of your document, upload the file and click 'Upload'. Has Microsoft lowered its Windows 11 eligibility criteria? Not the answer you're looking for? PDF.JS uses a