0
ASP.NET 코어에서 Rotativa를 사용하려고합니다. 이것이 내 코드입니다.ASP.NET 코어에서 Rotativa 사용
public IActionResult Index(int artID)
{
var art = articleService.GetArticleForPrint(artID);
return View(art);
}
public IActionResult PrintSpecifcArticle(int id)
{
var report = new ActionAsPdf("Index", new { artID = id })
{
FileName = "Invoice.pdf"
};
return report;
}
나는이 패키지 설치 : Rotativa.NetCore 1.0.4
를하지만 나에게 그 오류를 줄 : Rotativa.NetCore이를 찾을 수 있기 때문에
System.ComponentModel.Win32Exception: The system cannot find the file
specified
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Rotativa.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String
switches, String html, String wkhtmlExe)
at Rotativa.NetCore.AsPdfResultBase.WkhtmlConvert(String switches)
at Rotativa.NetCore.AsResultBase.BuildFile(ActionContext context)
at Rotativa.NetCore.AsResultBase.ExecuteResult(ActionContext context)
at Microsoft.AspNetCore.Mvc.ActionResult.ExecuteResultAsync(ActionContext
context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.
<InvokeResultAsync>d__30.MoveNext()
아마도 관련이 없지만 왜 당신은'View()'내부에서'IActionResult'를 돌려주고 있습니까? 당신은 단지'예술을 돌려 보내지 않아야 할까? ' –
그게 문제가 아니에요, 색인 작업 전에 오류가 나타납니다 – mustafa
그럼, 오류는 분명히'Invoice.pdf' 찾을 수 없습니다 –