Save my ASP.NET MVC page as pdf

2020-07-14 05:31发布

How can i save my ASP.NET MVC page as PDF?

2条回答
冷血范
2楼-- · 2020-07-14 06:07

There are third party libraries available to do this for you with really good fidelity. I wrote this post that uses a tool I worked on. It has been specifically designed to work in server based environments.

查看更多
▲ chillily
3楼-- · 2020-07-14 06:29

It you want something that's very easy to use. Take a look at https://github.com/andyhutch77/MvcRazorToPdf

Tried and tested in my projects. Just read the documentation. It's as easy as 1, 2, 3. :)

If you encounter some issues go to their github page and click the Issues tab, maybe some of your questions are already resolved there.

P.S.

Some of the PDF libraries that require an executable program to run will not work when your app is deployed to Azure because Azure doesn't support exe files (I guess for security purposes) else you'll create a webjob just for the exe file.

查看更多
登录 后发表回答