On the View page, I have the following code:
<iframe style="width:800px; height:550px;" id="FileReload" src="@Url.Action("GetPDF", "Account", new { id = Model.Id })" onerror="function_documenthide();"></iframe>
Each browser has its own PDF.
The problem is the browser safari and IE. Safari does not show PDF and IE is soooo heavy.
I'm trying to show default PDF of all browsers using ViewerJS .
It works at the location where your PDF is (AppData / Document / test.pdf).
So I put this code to work with ViewerJS: (with server)
<iframe style="width:815px; height:550px;" id="FileReload" src="/ViewerJS/#../@Url.Action("GetPDF", "Account", new { id= Model.ID})"></iframe>
More does not work, give this problem below:
UPDATE
WithPDFlocationworks:
<iframestyle="float:right;" src="/ViewerJS/pdf-test.pdf" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe>
In the Controller it returns with type application / pdf:
PDF = ((byte[])reader["File"]);
return new FileContentResult(PDF, "application/pdf");
Any ideas?