0

I have a backend that serves me a PDF file as application/pdf content-type. I need to use rest client for getting the file for sending header reasons. The backend always returns application/pdf and I cannot set responseType right now.

Here is the header I get back:

Header

The data of the response is linearized pdf file. Is there a way for me to open the file in a new window in my Vue FE using the data I get in the response? Or maybe convert the data to a blob and then open it? Or am I bound to request BE changes?

Esszed
  • 597
  • 1
  • 3
  • 15
  • Does this answer your question? [Download and open PDF file using Ajax](https://stackoverflow.com/questions/1999607/download-and-open-pdf-file-using-ajax) – Yogi Jun 01 '22 at 21:21
  • @Yogi the top answer does not work for me and the rest are relying on changing responseType. – Esszed Jun 02 '22 at 10:57
  • Then you may want to review the [hundreds of similar questions](https://stackoverflow.com/search?q=%5Bjavascript%5D+ajax+pdf+open) on SO as perhaps one will provide the answer you need. The reason your question hasn't received any responses is because there is no code and not enough detail to really know the problem. – Yogi Jun 03 '22 at 12:21

0 Answers0