Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert HTML to PDF in ASP.NET MVC Razor
Message
 
 
To
12/07/2012 05:53:23
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01548276
Message ID:
01548279
Views:
43
>HiQPdf HTML to PDF Converter can be used in ASP.NET MVC or ASP.NET MVC Razor applications. A special case is when the view you want to convert to PDF uses some values stored in ASP.NET Session. This values can be made available in the MVC view when converted to PDF.
>
>When you convert an ASP.NET MVC URL, the converter will make a GET request to the URL in a new session and the values stored in the current ASP.NET Session are not available. The solution is to get the HTML code rendered by the MVC view in the current context of the MVC controller and to convert that HTML code to PDF giving the appropriate base URL.
>
>The sample code below demonstrates this solution. When the 'Convert This Page to PDF' button in the Index view is pressed the Index view itself is converted. When the 'Convert About Page to PDF' button in the Index view is pressed the About view in the same application is converted to PDF.
>
>
>Source Code Samples - MVC Controller C# Code and MVC Razor Code at HiQPDF HTML to PDF .NET Library
>


I guess my brain hasn't warmed up yet this morning. Why would you want to convert a web page to a PDF? Documentation?
Previous
Reply
Map
View

Click here to load this message in the networking platform