nreco pdf生成错误点网 [英] nreco pdf genreation error dot net

查看:158
本文介绍了nreco pdf生成错误点网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用nreco库生成pdf,并且在生成时遇到此异常.

I am trying to generate pdf using nreco library and i am getting this exception while generating.

(退出代码:-1073741819) 说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息. 异常详细信息:NReco.PdfGenerator.WkHtmlToPdfException :(退出代码:-1073741819) 源错误: 当前Web请求的执行期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息. 堆栈跟踪: [WkHtmlToPdfException :(退出代码:-1073741819)] NReco.PdfGenerator.HtmlToPdfConverter.CheckExitCode(Int32 exitCode,String lastErrLine,Boolean outputNotEmpty)+134 NReco.PdfGenerator.HtmlToPdfConverter.InvokeWkHtmlToPdf(PdfSettings pdfSettings,字符串inputContent,流outputStream)+644 NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdfInternal(WkHtmlInput [] htmlFiles,String inputContent,String coverHtml,String outputPdfFilePath,Stream outputStream)+1282

(exit code: -1073741819) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: NReco.PdfGenerator.WkHtmlToPdfException: (exit code: -1073741819) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [WkHtmlToPdfException: (exit code: -1073741819)] NReco.PdfGenerator.HtmlToPdfConverter.CheckExitCode(Int32 exitCode, String lastErrLine, Boolean outputNotEmpty) +134 NReco.PdfGenerator.HtmlToPdfConverter.InvokeWkHtmlToPdf(PdfSettings pdfSettings, String inputContent, Stream outputStream) +644 NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdfInternal(WkHtmlInput[] htmlFiles, String inputContent, String coverHtml, String outputPdfFilePath, Stream outputStream) +1282

需要帮助.

推荐答案

此错误(如退出代码:-1073741819")表示wkhtmltopdf进程已被压缩.可能的原因:

This error (like "exit code: -1073741819") means that wkhtmltopdf process was crushed. Possible reasons:

  • wkhtmltopdf可执行文件与操作系统不兼容.举例来说,MSVC版本-NReco.PdfGenerator nuget软件包中提供-不支持XP或2003 Server等旧版Windows版本(解决方法是使用MingGW版本).或者,如果Windows可执行文件用于Linux或Mac OS环境(解决方案使用NReco.PdfGenerator.LT nuget +为目标平台部署/安装正确的wkhtmltopdf二进制文件).
  • 缺少必需的Universal C运行时库(
  • wkhtmltopdf executable is incompatible with the OS. Say, MSVC build - which is shipped in NReco.PdfGenerator nuget package - doesn't support legacy Windows versions like XP or 2003 Server (workaround is using MingGW build). Or if windows executable is used with Linux or Mac OS environment (solution is using NReco.PdfGenerator.LT nuget + deploy/install correct wkhtmltopdf binaries for the target platform).
  • missed required Universal C runtime libs ( https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows ). This is rare case, as usually these libs are already installed by Windows Update.
  • if this error occurs only for concrete HTML this might be a problem with complex HTML layout or heavy JS script. For example, wkhtmltopdf 0.12.4 can crush when ChartsJS library is used by the page (workaround exists).

这篇关于nreco pdf生成错误点网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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