This is the response that I am getting from the api which is raw pdf data.
%PDF-1.4
%цдьЯ
1 0 obj
<<
/Type /Catalog
/Version /1.4
/Pages 2 0 R
/ViewerPreferences 3 0 R
>>
I tried to change it to a string and then encode as base64 which is giving an error, then tried to directly convert to base64 it is creating a pdf file but it's empty. I am not sure which library to use to download this content as pdf and then view it in expo application.
const Buffer = require('buffer').Buffer;
let encodedAuth = new Buffer(responseBlob).toString('base64'); //above raw pdf
I am trying to build an application which allow the user to download a pdf file, once the download is complete the user can view the pdf in the react native expo application