Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load DLL 'libwkhtmltox' or one of its dependencies #1

Open
Schecher1 opened this issue Mar 8, 2022 · 12 comments
Open

Unable to load DLL 'libwkhtmltox' or one of its dependencies #1

Schecher1 opened this issue Mar 8, 2022 · 12 comments

Comments

@Schecher1
Copy link

Hey,
I was looking for a HTML => PNG converter for C# and was very happy when I saw this. Everything looks good except when I get to the "imageConverter.Convert(new ImageSettings()" it throws an exception "System.DllNotFoundException".

image

@imaxs
Copy link
Owner

imaxs commented Mar 22, 2022

Hello,
This is a fairly common issue.

Windows reference - libwkhtmltox.dll
OSX reference - libwkhtmltox.dylib
Linux reference - libwkhtmltox.os

Add it to your project reference by custom Assembly reference & register in your startup project.

@Schecher1
Copy link
Author

Hello,

yes actually i thought about that and tested it out, but i get a VS Error (that's german and in english it says) "The reference is invalid or not supported".

I use VS2022, NET6 and as console.

I have tested the 32bit and the 64bit version

The files were in "HTMLconvert/HTMLconvert/Lib/".

any suggestions?

greetings
image

@imaxs
Copy link
Owner

imaxs commented Mar 27, 2022

The files were in "HTMLconvert/HTMLconvert/Lib/".
any suggestions?

Please make sure that the wkhtmltopdf dependencies are enabled correctly.

https://stackoverflow.com/questions/13791196/using-wkhtmltopdf-on-windows

@Schecher1
Copy link
Author

Schecher1 commented Mar 27, 2022

ur link is broken :D
image

@imaxs
Copy link
Owner

imaxs commented Mar 27, 2022

ur link is broken :D image

Hmm.. Must be some kind of github bug.

Here is the link: https://stackoverflow.com/questions/13791196/using-wkhtmltopdf-on-windows

Have you tried setting libwkhtmltox library dependencies manually?

https://wkhtmltopdf.org/downloads.html

@Schecher1
Copy link
Author

No, I just downloaded the file and added it under "Add project reference". Or what ur mean 😅

@imaxs
Copy link
Owner

imaxs commented Mar 27, 2022

No, I just downloaded the file and added it under "Add project reference". Or what ur mean 😅

Ah, so you need to install wkhtmltopdf first

@Schecher1
Copy link
Author

oh where?

@Schecher1
Copy link
Author

oh i have thought all the time that i only have to import the dll... oops

@Schecher1
Copy link
Author

I can only find links for linux, but I would also like to debug it on windows etc.

@imaxs
Copy link
Owner

imaxs commented Mar 27, 2022

oh i have thought all the time that i only have to import the dll... oops

you are right
But the wrapper for wkhtmltopdf doesn't see the dll. In this case it should be specified directly by changing the code.

I can only find links for linux, but I would also like to debug it on windows etc.

Unfortunately I didn't check the correct execution for Windows.
Perhaps one of these days I will release an update that will make the wrapper work correctly on Windows.

@Schecher1
Copy link
Author

that means it would work under linux? hm too bad, i don't really feel like developing on linux now. But Thanks, i´ll wait for the Windows Version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants