Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert HTML to PDF in ASP.NET MVC Razor
Message
 
 
À
12/07/2012 05:53:23
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01548276
Message ID:
01548279
Vues:
44
>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform