: PDF conversion on website using ASP.NET platform I want to give users an option to download the web page of my website they are currently viewing. I have searched and found 3rd party windows
I want to give users an option to download the web page of my website they are currently viewing. I have searched and found 3rd party windows software which convert the pages, but I am looking for an app that I can have on my website.
I am using C# on a ASP.NET platform.
More posts by @Deb1703797
2 Comments
Sorted by latest first Latest Oldest Best
I want to give users an option to download the web page of my website they are currently viewing.
It sounds like you're trying to convert your HTML output into PDF output, is this correct?
One of the best tools I've encountered for this is wkhtmltopdf. It's built on top of the Webkit rendering engine, the same engine that powers Safari, Chrome and the built-in browsers on Android devices and the iPhone.
Usage is pretty darn simple -- just a simple shell command pointing it at the HTML file in question and giving it the desired output filename. There are more options if you need them. I'm not sure how you'd go about actually making shell calls in the land of ASP.NET though.
While versions for Windows are available, I've only ever used it in a Linux environment, so YMMV. You will obviously need the ability to install programs on your server, which implies Administrator access.
I believe what you want to do is change the content disposition response header in the output you send back to the user. Have a look at the HttpResponse.TransmitFile method. Here is an additional article that may help too (can probably find several others that are similar).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.