M
M
meshoot2018-03-14 13:05:04
JavaScript
meshoot, 2018-03-14 13:05:04

Displaying pdf coming from the server?

Good afternoon, the task is to display a pdf document for printing.
The user selects the data in the window, presses the button, and the data goes from us to the server, if the request is successful, in response we receive a generated pdf file, but not a link, but the content itself
How to display this mess as a pdf file on a new page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander null, 2018-03-14
@meshoot

specify in the server response headers that it is a PDF,
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="'.$name.'"');

C
coderisimo, 2018-03-14
@coderisimo

use this mozilla.github.io/pdf.js/examples/index.html#inter... .
"PORRIDGE" is not a problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question