Rendering PDFs from a database inside MVC views?

Posted by Mohammad Sepahvand on Stack Overflow See other posts from Stack Overflow or by Mohammad Sepahvand
Published on 2012-11-29T17:54:19Z Indexed on 2012/11/29 23:05 UTC
Read the original article Hit count: 349

Filed under:
|
|
|

I was wondering if it's possible to do this without using 3rd party compnents in MVC 3. (I am open to free components though.) There are a couple of links out there but they seem to be mostly concerned with reporting and other code samples that do claim to do this sort of thing don't seem to compile. I'm not having any trouble saving and retrieving the PDFs to and from my database, but when I return the PDF as a File or a FileStreamResult the user is prompted with a download. A more desirable approach would be to actually render the PDFs inside the browser. I've had a look at iTextSHarp, it does the job to an extent, but it's not a complete solution. For example it will display the PDF inside the view if and only if the client has Adobe Reader installed, otherwise it prompts for a download. So technically, I'm mostly looking for a PDF viewer. Any ideas?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc