K
K
Kezuki II2019-06-17 23:29:31
JavaScript
Kezuki II, 2019-06-17 23:29:31

How to decode base64 pdf file to pdf file and output to separate page?

The server returns a base64 encoded pdf file to the client.
how to decode base64 file to pdf file and output to separate page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orbb, 2019-06-19
@humiliation

You have bytes in base64, right? so.
You decode, you get the file itself through new Blob() (for info in mdn or another dock)
You draw a link in the house, file the download attribute there - everything downloads fine, logically - you can give the PDF to the browser and it will view it, open it in a new tab. You can play with iframes. Dig in this direction. I did something similar recently, but in IE11 and below it didn’t want to work at all, I made it so that the browser directly receives a link to bytes from octet-stream and starts downloading itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question