How to convert pdfFileFormat string to a blob in Javascript (for uploading it to firebase)?

I get a response of pdf file format as shown below:

'%PDF-1.5rn4 0 objrn<</Type /Page/Parent 3 0 R/Contents 5 0 R/MediaBox [0 0 612 792]/Resources<</Font ....

It seems to be some encoded string and all I want is to be able to create Object Url or the blob out of it that I could use to upload in firebase. I am not sure how to do that. Can someone help?