wkhtmltopdf / packaging

Packaging of wkhtmltopdf releases
https://wkhtmltopdf.org/downloads.html#stable
301 stars 136 forks source link

Building NPM package with wkhtmltopdf as dependency #112

Closed DHVPP closed 2 years ago

DHVPP commented 2 years ago

Hello,

I'm building a native module for Nodejs using wkhtmltox package. Right now, in our bindings configuration we are using the libwkhtmltox.so file to compile our package and it works perfectly, on my PC.

As far as I understood, I need a static version of this file to be compiled with my package, but I'm having trouble finding a way to recompile wkhtmltox package to include this file.

Could you please point me to the right direction as to where to look and if this thinking of mine is right, as this is the fist time I'm working with native packages.

Thanks for the read.

ashkulz commented 2 years ago

This won't work, as you'll need a version for every supported distro and then depending on the relevant distro use that binary. See wkhtmltopdf_binary_gem on how a similar approach in Ruby works.

DHVPP commented 2 years ago

Thank you so much for the replay.

I made this package primarily for my clients project which runs only on Ubuntu 18.04. So if this approach could would work only for one distro right now, I'd be grateful if you could tell me how to build the static version of this file.

Thanks again

ashkulz commented 2 years ago

Download this package (assuming you're using amd64) and google from extract from deb -- you should be able to extract the libwkhtmltox.so.0.12.6 from it (you can rename it to libwkhtmltox.so if you want).

DHVPP commented 2 years ago

I'm sorry to be reopening this issue, but I might have not explained myself as well as I should have. This client project is an Electron application that uses my package for printing (wkhtmltox is used for fast conversion of html to pdf before printing), so using shared object is not ideal as it would require maintenance on 3000 PCs before the update of the application is run. All i need is info on how to create a static object for Ubuntu 18.04 OS as that's the only OS that is running the App right now, so that the app could be compiled with that .a object.

Thanks again for your time.

ashkulz commented 2 years ago

Note that unless you're distributing the application you're building under the terms of the LGPLv3, it might not be legal to link it statically.

DHVPP commented 2 years ago

We haven't decided yet on the license we are going to use, but if complying with LGPLv3 is required for us to successfully ship this package with static linking to wkhtmltox, we would gladly comply.