I have a PHP script which make a curl request to remote server and get PDF file in response. If I store this response to file it is correct PDF file. Now I need to send thid file to browser as json cause initial request was ajax from browser. But dont know how to do it. The browser solution should be something like this https://stackoverflow.com/a/27563953/2092927 and I have it prepared. But I dont know how to send PDF from PHP as json. I know how to send it to download via common http request but dont know how to send it like json.
Does somebody know how to do it? Thanks for help.