One JAVA API is returning a pdf file as OutputStream and below is the API response as a string:
'%PDF-1.5\n%����\n2 0 obj\n<</Filter/FlateDecode/Length 49>>stream\nx�+�r\n�22U0�4R\bI�r\r�\n�*T0T0\x00B\b����\x1F�f�'
I want it to convert to Base64 in JavaScript. Is this possible?