0
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 safari browser and IE. Safari does not show PDF and IE is too heavy.
I’m trying to show standard PDF of all browsers using Viewerjs.
It works 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, gives this problem below:
UPDATE
With local PDF works:
<iframe style="float:right;" src="/ViewerJS/pdf-test.pdf" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe>
In Controller it returns with application/pdf type:
PDF = ((byte[])reader["File"]);
return new FileContentResult(PDF, "application/pdf");
Any idea ?
Which browser? Which error occurs?
– Laerte
In fact all browsers do not show PDF using Viewerjs, plus google Chrome shows error.
– Matheus Miranda
Error : The provided value 'Moz-chunked-arraybuffer' is not a Valid Enum value of type Xmlhttprequestresponsetype.
– Matheus Miranda
@Laerte the problem has been solved, see the answer.
– Matheus Miranda