[英]What is the cause of Rotativa not working properly on the server?
我使用 Rotativa 和 wkhtmltopdf.exe 将视图转换为 pdf 并且我的代码在本地运行。 但它只在服务器上工作一次,第二次挂起。 之后,服务器将不再工作。
我需要对 wkhtmltopdf.exe 进行任何特殊调整吗? 因为我猜在第一次使用 wkhtmltopdf 之后,它会变得很忙。 也许还有另一个我不知道的原因。
它是我的代码:
var _pdf = new ActionAsPdf("Print");
_pdf.PageMargins.Bottom = 0;
_pdf.PageMargins.Top = 0;
_pdf.PageMargins.Right = 0;
_pdf.PageMargins.Left = 0;
_pdf.Cookies = cookieCollection;
_pdf.PageOrientation = Rotativa.Options.Orientation.Portrait;
_pdf.PageSize = Rotativa.Options.Size.A4;
_pdf.CustomSwitches = "--disable-smart-shrinking";
byte[] applicationPDFData = _pdf.BuildFile(ControllerContext);
并尝试使用 UrlAsPdf,也:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
我使用 ssl 站点和身份验证。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.