- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发 .net5.0 网络 API,但在使用 DinkToPdf 时出现以下错误:
DllNotFoundException: Unable to load DLL 'libwkhtmltox' or one of its dependencies: The specified module could not be found. (0x8007007E)
我关注了this教程,但有一些异常(exception):
added the service 添加了服务,教程中没有做到
services.AddSingleton(typeof(IConverter),
new SynchronizedConverter(new PdfTools()));
...
services.AddScoped<IPdfService, PdfService>();
以不同方式命名服务,但这无关紧要
通过 NuGet 而不是 Install-Package DinkToPdf
我的项目只是一个 API,前端不是在 C# 中,应该无关紧要,因为错误在这里:
return this._converter.Convert(htmlToPdfDocument);
按照教程中的方式完成其他所有操作。
最佳答案
对我而言,将其添加到 csproj 文件中解决了问题 -
<ItemGroup>
<None Remove="libwkhtmltox.dll" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="libwkhtmltox.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
关于c# - 找不到 DinkToPdf dll libwkhtmltox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66818105/
我正在开发 .net5.0 网络 API,但在使用 DinkToPdf 时出现以下错误: DllNotFoundException: Unable to load DLL 'libwkhtmltox'
我有一张使用 .Net Core 3 Web API 和 DinkToPdf 库创建的 pdf 发票。 现在我需要在 pdf 中插入图像作为签名。我创建了项目的 Resource 文件夹,并添加了 C
我的 Program.cs 中有这个 C#: var page = "plain"; var slnpath = $@"{Directory.GetCurrentDirectory()
我正在尝试使用 DinkToPdf 从 HTML SQL 服务器数据库生成 PDF图书馆。 在我添加的启动文件中: var context = new CustomAssemblyLoadContex
我编写了一个 PDF 生成 API,它使用 dinktopdf将一些模板化 HTML 转换为字节数组。这一切在我的本地计算机上运行良好,但是当我部署到我的 Azure Web 应用程序时,API 只能
我有一个使用 DinkToPdf 的 Azure 函数(不是容器函数)。 我已将其升级到 .NET 6 和 Azure V4。 我现在收到此错误: One or more errors occurre
我是一名优秀的程序员,十分优秀!