You cannot guarantee to display PDF file, by definition. PDF is not a part of W3 standards; and I would be glad if it never become standardized with the Web; it's concept is very foreign to Web. It does not present any problems: the
content type is standardized. You just need to provide the file by the fragment of HTML code generated on your server side, such as
<a href="yourPdfFile.pdf">Your PDF file</a>
To do so, you would need to have this file on your server side, in a file system, or create such file dynamically. This is not always acceptable. You can also generate PDF content on the fly, make it an ASP.NET page returning the content in HTTP response. To do so, your server-side code should generate the content in
HTTPResponse
and write appropriate
content-type header, with the content type "application/pdf". Please see:
HttpResponse Class (System.Web),
HttpResponse.ContentType Property (System.Web),
Media Types (IANA supports the standard for all media types).
This is a set of references to PDF libraries you can use:
http://csharp-source.net/open-source/pdf-libraries.
Here is how it will work:
You cannot assume that anything supporting PDF is installed on the client machine. The client can have PDF plug-in enabled in the browser, then it will be shown in the browser window. If not, the user will be given a choice to open the PDF in a default PDF viewer. Such viewer may or may not exist; if not, the user will have a choice to save the file locally and open it later; the software for opening the file also may or may not exist, but this is not a problem and not your concern.
—SA