Windows Server 2008 R2 x64 环境上的 WkHtmlToXSharp 错误
WkHtmlToXSharp 是优秀的 Html 到 PDF 转换库 wkhtmltopdf 库的 C# 包装器(使用 P/Invoke)。 https://github.com/TobiTonner/WkHtmlToXSharp
我有两个关于暂存 Windows Server 2008 R2 x64 环境的网站 其中一个网站是A版本的网站,另一个网站是B版本。
WkHtmlToXSharp 转换在 A 版本上运行,但是当我设置 B 版本时,转换无法在该版本上运行,我收到错误:
HtmlToPdf conversion failed: Failed loading page http://website/Convert (sometimes it will work just to ignore this error with --load-error-handling ignore)
我想知道为什么会这样正在发生,然后我指向 A 网站查找与 B 网站正在查找的文件夹相同的文件夹。令我惊讶的是,当我运行 A 转换时运行良好,但是当我破坏 B 时,我仍然遇到相同的错误,但有趣的是,两者的站点指向相同的源代码(文件夹)。我只是想知道为什么会发生这种情况。这两个网站都有相似的应用程序池配置,并且在它们的机器人中启用 32 位应用程序设置得太正确。另外,我试图为两个网站设置相同的应用程序池,但仍然发生同样的事情,网站 A 上的转换正常,但 B 网站上的转换无效。
在我的本地环境(Windows 7 x64)上,如果我设置在两种情况下都有效的相同网站转换。
我还对代码进行了一些更改以忽略错误: converter.ObjectSettings.Load.LoadErrorHandling = LoadErrorHandlingType.ignore;
但它并不能修复错误,唯一的区别是,现在我在 B 网站上进行转换时得到空的 pdf。
我只是想可能是 Windows Server 中的某些东西拒绝在内存中运行/保留 WkHtmlToXSharp.dll 或 wkhtmltopdf 的两个副本或类似的情况。
也许有人对此有什么想法?
WkHtmlToXSharp is C# wrapper (using P/Invoke) for the excelent Html to PDF conversion library wkhtmltopdf library. https://github.com/TobiTonner/WkHtmlToXSharp
I have two websites on staging Windows Server 2008 R2 x64 environment
One of them let say web site A version of website and another one web site B.
The WkHtmlToXSharp conversion was working on the A version but when I set up an B version an conversion not working on that version, I am getting an error:
HtmlToPdf conversion failed: Failed loading page http://website/Convert (sometimes it will work just to ignore this error with --load-error-handling ignore)
I was wondering why it is happening and than I pointed A website to look in to the the same folder as B site is looking. And I was surprised that when I am running A conversion working well there, but when I am ruining B I am still getting the same error, but the funny thing is that both of sites pointed to the same source code(folder). I am just wondering why it is happend. Both websites has the similar app pool configurations and Enable 32-bit apps set too true in bot of them. Also i was trying to set the same app pool for both websites and still the same thing taking place, conversion on site A is working but on B site is not.
On my local environment(Windows 7 x64) if I set the same websites conversions working in both cases.
Also I made some changes in code to ignore the errors :converter.ObjectSettings.Load.LoadErrorHandling = LoadErrorHandlingType.ignore;
but it is does not fix the error, only the difference is that now I am getting empty pdf in case of conversion on B web site.
I just thinking may be it is something in Windows Server which deny to run/keep in memory two copies of WkHtmlToXSharp.dll or wkhtmltopdf or something kind of like that is going on.
Maybe some one have any ideas about that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此https://github.com/pruiz/WkHtmlToXSharp/issues/8
希望有帮助。
See this https://github.com/pruiz/WkHtmlToXSharp/issues/8
Hope it helps.