#1
Posted
:
Friday, July 31, 2020 1:51:17 PM(UTC)
Groups: Registered
Posts: 5
Thanks: 1 times
I'm attempting to convert HTML files to PDF in Java using LeadTools 20, and am receiving the following exception:
Exception in thread "main" leadtools.RasterException: The libltwebkitengine.so library is missing.
I have not had any issues converting other formats to PDF, and have verified that the file is present in the path that I've passed to the setInitialPath function. Does this file need to be placed elsewhere, or otherwise activated/loaded? Thanks!
#2
Posted
:
Friday, July 31, 2020 2:47:44 PM(UTC)
Groups: Registered, Manager, Tech Support, Administrators
Posts: 107
Was thanked: 9 time(s) in 9 post(s)
Hi Steve,
The issue that you are experiencing should be that you are using the WebKit HTML engine, but the required dependencies needed to use this are not being found in your application.
https://www.leadtools.co...co/codecshtmlengine.htmlYou can normally switch the HTML engine used by using the following code:
Code:using (RasterCodecs codecs = new RasterCodecs())
{
// Set the default HTML rendering engine to WebKit
codecs.Options.Html.Load.HtmlEngine = CodecsHtmlEngine.WebKit;
using (RasterImage image = codecs.Load("file.html", 1))
{
// Do something with image
}
}
https://www.leadtools.co...o/codecshtmloptions.htmlI recommend that you stick with using the Webkit HTML engine as it usually provides better results. As you can see in our documentation, usage of the WebKit engine requires an external dependency which is found in the download we provide in the documentation. With this, you just need to ensure that you have the wkhtmltox.dll (Windows) or wkhtmltox.so (Linux) in the folder where your application is building to. For instance, if your application is pulling all the references it needs from a "Bin" folder, you'll just want to include the .so file or dll into that build directory.
Thanks,
Edited by user Friday, October 15, 2021 1:30:40 PM(UTC)
| Reason: update link
Marcus Andra
Developer Support Engineer
LEAD Technologies, Inc.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.