为什么将IronPdf与Renderer.RenderHtmlAsPdf一起使用时,为什么无法加载共享库'IronPdf_ChromeRenderingEngine'?

时间:2019-05-14 20:11:09

标签: docker ubuntu .net-core

我有一个配置有docker(Debian GNU / Linux)的.net core 2.1项目。我正在使用PDF.Core 5.2.0。

在下面的代码中使用RenderHtmlAsPdf方法时,会出现此错误:193: binding file /usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0] to /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]: normal symbol _Unwind_Resume_or_Rethrow' [GCC_3.3] 193: symbol=_Unwind_RaiseException; lookup in file=/usr/bin/dotnet [0] 193: symbol=_Unwind_RaiseException; lookup in file=/lib/x86_64-linux-gnu/libdl.so.2 [0] 193: symbol=_Unwind_RaiseException; lookup in file=/lib/x86_64-linux-gnu/libpthread.so.0 [0] 193: symbol=_Unwind_RaiseException; lookup in file=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0] 193: symbol=_Unwind_RaiseException; lookup in file=/lib/x86_64-linux-gnu/libm.so.6 [0] 193: symbol=_Unwind_RaiseException; lookup in file=/lib/x86_64-linux-gnu/libgcc_s.so.1 [0] 193: binding file /lib/x86_64-linux-gnu/libgcc_s.so.1 [0] to /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]: normal symbol _Unwind_RaiseException' [GCC_3.0] Exception thrown: 'System.DllNotFoundException' in IronPdf.Core.dll: 'Unable to load shared library 'IronPdf_ChromeRenderingEngine' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libIronPdf_ChromeRenderingEngine: cannot open shared object file: No such file or directory' Stack trace: at 맬.릺.wkhtmltopdf_init(Int32 useGraphics) at 맬.맢.Load() '

我尝试在Windows 10 OS上不使用docker的情况下运行项目,而相同的代码也没有问题。仅适用于docker / linux。

public static void Main(string[] args)
{
    var Renderer = new IronPdf.HtmlToPdf();
    //following line is causing the error
    var PDF = Renderer.RenderHtmlAsPdf("<h1>Hello test</h1>");
    var OutputPath = "HtmlToPDF.pdf";
    PDF.SaveAs(OutputPath);
}

1 个答案:

答案 0 :(得分:0)

此错误是由瘦docker映像中缺少依赖项引起的。 IronPDF已使用必需的步骤更新了其文档,以安装转换html2pdf https://ironpdf.com/docs/questions/docker-linux/

时所需的所有依赖项。