asp.net-mvc-4 - 仅在服务器上找不到 Rotativa 文件

标签 asp.net-mvc-4 rotativa

我正在使用 Rotativa ActionasPDF() 从我的 MVC4 项目中的 View 生成 pdf。它在我的本地实例上完美运行,但我只是将整个解决方案复制到我的服务器上,但它不起作用。我收到错误“系统找不到指定的文件”,但我不确定它在谈论什么文件。我假设它在谈论 Rotativa dll,但我的服务器上也有生成的 Rotativa 文件夹。该解决方案与我的本地副本完全相同。我的网站托管在 IIS 8、Windows 2012 服务器上。研究告诉我,某些文件夹可能存在权限问题,但我不确定它们会是哪些。我只是暂时将所有 Controller 和 View 设置为 777 权限。没运气。关于我缺少什么的任何想法,或者我如何确保 dll 已在我的服务器上注册?

这是我的 Controller 操作方法:

public ActionResult DownloadFile(int id = 0)
    {
        var filename = string.Format("Invoice{0}.pdf", id);

        return new ActionAsPdf("Invoice" + "/" + id, new { name = "Invoice" + id }) { FileName = filename, PageSize = Size.Letter, PageOrientation = Orientation.Portrait, PageMargins = new Margins(0, 0, 0, 0) };
    }

enter image description here

最佳答案

检查您是否在服务器上的 rotativa 目录中添加了所有文件 -

libeay32.dll

wkhtmltopdf.exe

关于asp.net-mvc-4 - 仅在服务器上找不到 Rotativa 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28434069/

相关文章:

highcharts - 将 wkhtmltopdf 与 highcharts 结合使用显示空白图表

ASP.NET MVC 在 httpPost 后返回索引 View

javascript - Jquery $ 标记转义

asp.net-core-mvc - 如何在 ASP.NET Core 6 MVC 中设置 Rotativa.aspnetcore 配置

asp.net-mvc-4 - TFS checkin 请求被中止: The request was canceled

asp.net-mvc-4 - 如何将复杂模型传递给 ActionAsPDF?

pdf - 我正在使用 Rotativa 工具来显示 pdf。它在本地主机上运行良好,但在 Azure 平台上不起作用

C#MVC : Cannot Debug in IIS Express

asp.net-mvc-4 - 如何在 Kendo UI Grid 中的页面加载时展开所有行?

c# - 将类型为 `Kendo.Mvc.UI.DataSourceRequest` 的对象从 jquery 传递到 Mvc Action