I have a pdf that i returned by stream in a json result by my GetTestReport action:
return this.Json(pdfInBytes);
And in my view:
$.post('@Url.Action("GetTestReport", "Reports")', function(data) {
// What have i put here?
});
How can i show the pdf in a entire page, or in a specific div?
The PDF can’t be embedded in a document, it’s a document itself, and you can’t put it in a JSON result, you’ll put its URL in JSON.
Then you can still place it in an iFrame (it will be the source
src). Or you dowindow.open('you_pdf_url.pdf');to show it in a new tab.