Hi,
Hello,
I have a .Net core project (MVC design - .net 7). I would like the user to be able to download a razor view as a PDF file.
The razor view uses a layout.cshtml file where all the css, js, images files are referenced. The view is also dynamic (reads data from model). The button to convert the html to PDF will be on the same razor view.
What is the best way to convert this razor view into a PDF file with the
Syncfusion.HtmlToPdfConverter.Net.Windows NuGet package ?
It seems there are two approaches : either get the html document of the current view as a string via Javascript and then send to server-side or instantiate a web client on server side which calls the razor page and download the resulting html as a string. Let me know what method you recommend and potentially provide code sample.
Thanks for the help !