I have generated a string of a file using this:
const reader = new window.FileReader();
reader.readAsDataURL(file);
reader.onloadend = () => {
var x = reader.result.toString();
console.log("File String :: ", x);
};
How to convert this string to actual file like if the previous file was a PDF then this string will converted to a pdf file
reader.result.toString()
gives me a string like this "data:application/pdf;base64,JVBERi0xLjQKJSDi48/..........."
I want to convert it back to pdf
FileReader.readAsDataURL()