Asp.net mvc 我可以使用html2pdf将asp.net MVC中的Index.cshtml转换为PDF吗?
我在使用html2pdf库和jquery将asp.net MVC中的视图转换为PDF时遇到问题, 有人能帮忙吗Asp.net mvc 我可以使用html2pdf将asp.net MVC中的Index.cshtml转换为PDF吗?,asp.net-mvc,pdf,model-view-controller,converters,html2pdf,Asp.net Mvc,Pdf,Model View Controller,Converters,Html2pdf,我在使用html2pdf库和jquery将asp.net MVC中的视图转换为PDF时遇到问题, 有人能帮忙吗 提前谢谢。我用的是Rotativa,看起来不错 Rotativa是一个开源软件包,它使用Chrome浏览器使用的web工具包引擎来呈现HTML。此框架支持大多数HTML标记和样式。 它包含许多可用于转换为pdf的类,如: 行动ASPDF PartialViewAsPdf UrlAsPdf ViewAsPdf 比如说 @Html.ActionLink(“打印员工”, “PrintEm
提前谢谢。我用的是Rotativa,看起来不错 Rotativa是一个开源软件包,它使用Chrome浏览器使用的web工具包引擎来呈现HTML。此框架支持大多数HTML标记和样式。 它包含许多可用于转换为pdf的类,如:
- 行动ASPDF
- PartialViewAsPdf
- UrlAsPdf
- ViewAsPdf 比如说
@Html.ActionLink(“打印员工”,
“PrintEmployee”,新的{id=Model.id})
public ActionResult PrintEmployee(内部id)
{
var report=new Rotativa.ActionAsPdf(“雇员”,new{id=id});
返回报告;
}
请尽可能详细地写出错误消息以及您可能遇到问题的源代码中最相关的部分。
<div style="text-align:right">@Html.ActionLink("Print Employee",
"PrintEmployee", new { id=Model.ID })</div>
public ActionResult PrintEmployee(int id)
{
var report = new Rotativa.ActionAsPdf("Employee", new { id=id });
return report;
}