从MVC3 Razor应用程序下载PDF格式的页面 [英] Download pages as PDF from a MVC3 Razor apllication

查看:93
本文介绍了从MVC3 Razor应用程序下载PDF格式的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个MVC3,Razor引擎应用程序有8个不同的视图(.cshtml)。我有这些页面供用户输入个人详细信息和其他我需要下载所有这8页(.cshtml)的内容,如按一下按钮点击浏览器中的单个PDF文件并保存。页面(.cshtml)包含下拉框,日历,收音机等控件视图中的一些内容是从模型中加载的。请帮助。



谢谢,

Jaison

Hello,

I have a MVC3, Razor engine application having 8 different views(.cshtml).I have these pages for users to enter personal details and other things.I have a requirement to download the content of all these 8 pages(.cshtml) as shown in browser in a button click as a single PDF file and save it.The pages(.cshtml) contains controls like dropdownbox,calender,radio button etc.Some of the contents in the views are loaded from models.Please Help.

Thanks,
Jaison

推荐答案

你可以使用nuget(RazorPDF for MVC)将razor页面导出为pdf格式,基本上我们需要iTextSharp库来创建pdf。

以下是链接如何通过razorpdf导出pdf



http://www.dotnetjalps.com/2013/06/Creating-PDF-with-ASP-Net-MVC-and-RazorPDF.html [ ^ ]
You can use nuget (RazorPDF for MVC) for exporting razor page to pdf format , basically we need iTextSharp library for the pdf creation.
following is the link how to export pdf by razorpdf

http://www.dotnetjalps.com/2013/06/Creating-PDF-with-ASP-Net-MVC-and-RazorPDF.html[^]


这篇关于从MVC3 Razor应用程序下载PDF格式的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆