我正在测试NReco PDF生成器,以从C#代码生成PDF文件。到目前为止,这个组件运行得很好,但是今天我在生成PDF时记录了一个异常:
System.Exception: Cannot generate PDF: (exit code: -1073741628)
---> NReco.PdfGenerator.WkHtmlToPdfException: (exit code: -1073741628)
at NReco.PdfGenerator.HtmlToPdfConverter.CheckExitCode(Int32 exitCode, String lastErrLine, Boolean outputNotEmpty)
at NReco.PdfGenerator.HtmlToPdfConverter.InvokeWkHtmlToPdf(PdfSettings pdfSettings, String inputContent, Stream outputStream)
at NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdfInternal(WkHtmlInput[] htmlFiles, String inputContent, String coverHtml, String outputPdfFilePath, Stream outputStream)
--- End of inner exception stack trace ---
at NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdfInternal(WkHtmlInput[] htmlFiles, String inputContent, String coverHtml, String outputPdfFilePath, Stream outputStream)
at NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdf(String htmlContent, String coverHtml, Stream output)
at NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdf(String htmlContent, String coverHtml)有人知道这是什么原因,或者我如何调试它?
发布于 2019-09-12 08:02:25
当您看到奇怪的退出代码(如exit code: -1073741628 )时,这意味着wkhtmltopdf进程由于某种原因而被压碎。要获得更多详细信息,您可以:
Wkhtmltopdf有一些已知的问题尚未解决,可能会导致进程崩溃;这可能是:超出页面尺寸的页脚内容太长;元素与边框半径的特定组合;特定的js代码。
https://stackoverflow.com/questions/57859211
复制相似问题