wkhtmltopdf-binary-edge icon indicating copy to clipboard operation
wkhtmltopdf-binary-edge copied to clipboard

wkhtmltopdf 12.5.0 - libjpeg.so.8 ... no such file or directory

Open stevebutler2210 opened this issue 6 years ago • 21 comments

After updating to the latest version of the gem, I'm getting the following error message whenever I try and use wkhtlmtopdf:

/usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

Any idea what we can do to resolve this? Can't seem to manually install the dependency via apt-get.

stevebutler2210 avatar Sep 20 '18 15:09 stevebutler2210

I got this error on Heroku after updating to the Heroku-18 Stack from the Heroku-16 stack. I tried solving it with the Apt buildpack (https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt) since it seems there has been a change in libpng between stack versions (link here), but no luck. I had to downgrade our Heroku application to the Heroku-16 Stack for this error to go away.

martinbjeldbak avatar Sep 24 '18 04:09 martinbjeldbak

Hmm, we're no Heroku on our project at all, this is just being bundled with gem 'wkhtmltopdf-binary-edge', '~> 0.12.4.0'

stevebutler2210 avatar Sep 24 '18 07:09 stevebutler2210

I have the same error. no solution yet

SalvesTestservices avatar Sep 24 '18 09:09 SalvesTestservices

Have you changed or updated the system in any way? This was directly related to a missing dependency on the Ubuntu 16.04 server.

martinbjeldbak avatar Sep 26 '18 11:09 martinbjeldbak

I guess the binaries are built on either wheezy or a fork of wheezy (ubuntu 14.04) , as newer versions have libjpeg.so.62.

Since most docker images now use stretch instead of wheezy as base, that will be the reason for it to not work on heroku, as newest stack is based on stretch.

See overview over the various versions here: https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=libjpeg

leifcr avatar Oct 03 '18 18:10 leifcr

I get a similar error with libpng: Command Error: /app/vendor/bundle/ruby/2.5.0/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

what to do?

benoitongit avatar Oct 04 '18 02:10 benoitongit

Either go with a stack that has libraries needed by the newest version of the gem, or use 0.12.4. (At least that works fine here).

leifcr avatar Oct 08 '18 12:10 leifcr

Hi. This could be addressed by #16

kewubenduben avatar Oct 10 '18 11:10 kewubenduben

I've had to downgrade to 0.12.40 on Stretch due to this issue.

jefmathiot avatar Dec 21 '18 08:12 jefmathiot

I've had to downgrade to 0.12.40 on Stretch due to this issue.

Thanks, @jefmathiot! Same here.

alvarofernandoms avatar Jan 30 '19 17:01 alvarofernandoms

I am too facing the same issue that unable to display images served over https. I am finding difficulty to fix this issue.

  1. Tried with 0.12.5.0 but this gives libjpeg.so.8 error. This gives below error: Screenshot 2019-03-18 at 7 32 04 PM

  2. Tried with 0.12.4. but this does not render https images.

  3. Tried with 0.12.2.1, but this also does not render https images.

However, when I tried rendering blob image, it worked.

Using blob format is the least option I would like to opt since my pdf shall have lots of images. Looks like switching the version did charm for everyone. Any ideas why didn't it work for me?

Am I missing anything? Please advise.

kavitakanojiya avatar Mar 18 '19 14:03 kavitakanojiya

@kavitakanojiya images work just fine here with 0.12.4, however, all images here are loaded as local file:// links instead of http/https. I opted for this, as I had issues with http/https images as well.

leifcr avatar Mar 26 '19 20:03 leifcr

Hey Folks sorry for the super delayed response.

This repo just provides the binaries needed for development. If you need to run this on heroku, please use https://github.com/rposborne/wkhtmltopdf-heroku instead.

There are currently some issues with wkhtmltopdf 0.12.5 on Ubuntu 18 - please use 0.12.4 or 0.12.3 (which I am currently using) instead.

If you have any issues with wkhtmltopdf itself, please open a ticket here https://github.com/wkhtmltopdf/wkhtmltopdf

Thanks!

pallymore avatar Apr 23 '19 14:04 pallymore

@kavitakanojiya did you solved this issue with images served over https?

I am too facing the same issue that unable to display images served over https. I am finding difficulty to fix this issue.

  1. Tried with 0.12.5.0 but this gives libjpeg.so.8 error. This gives below error:
Screenshot 2019-03-18 at 7 32 04 PM
  1. Tried with 0.12.4. but this does not render https images.
  2. Tried with 0.12.2.1, but this also does not render https images.

However, when I tried rendering blob image, it worked.

Using blob format is the least option I would like to opt since my pdf shall have lots of images. Looks like switching the version did charm for everyone. Any ideas why didn't it work for me?

Am I missing anything? Please advise.

iamhimateja avatar Sep 17 '19 07:09 iamhimateja

If it helps, I tried a bunch of different options and only got the images to render using both of these gems:

   gem 'wkhtmltopdf-binary-edge', '~> 0.12.2.1'
   gem 'wkhtmltopdf-heroku', '2.12.5.0'

LizBayardelle avatar Oct 27 '19 17:10 LizBayardelle

Hi @LizBayardelle - I don’t think that’s a valid fix. The two gems basically are doing the same thing (with different versions of wkhtmltopdf) except the 2nd gem only works under Ubuntu 18.

What is the OS you are using? (For dev and production) And which gem you are using for creating PDFs

pallymore avatar Oct 27 '19 18:10 pallymore

Hello Guys! We have any update about that?

rafaeldev avatar Nov 28 '19 02:11 rafaeldev

Hi there - if you are using Ubuntu 18 - please use the wkhtmltopdf-heroku gem instead.

Otherwise you may install the missing dependency with this

download the package to the /tmp folder:

wget -q -O /tmp/libpng12.deb http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

install it with dpkg

dpkg -i /tmp/libpng12.deb

remove the deb file from the /tmp folder:

rm /tmp/libpng12.deb

this worked for me in Ubuntu 18.04.

pallymore avatar Nov 28 '19 02:11 pallymore

I've had to downgrade to 0.12.40 on Stretch due to this issue.

This worked for me ! :)

ananthsathvick avatar Oct 08 '20 06:10 ananthsathvick

For anyone who still faced this issue, You can try with downgrade the version to 0.12.4

find wkhtmltopdf-binary-edge OR wkhtmltopdf-binary (inside gemfile.lock), then change to this:

wkhtmltopdf-binary (0.12.4)

then run 'bundle install' in your terminal

thanks to @jefmathiot

mrobbizulfikar avatar Mar 04 '21 15:03 mrobbizulfikar

This error also appears if you have not installed wkhtmltopdf sudo apt-get install zlib1g fontconfig libxrender1 libfreetype6 libxext6 libx11-6 sudo apt-get install wkhtmltopdf

kazmin avatar Apr 30 '22 13:04 kazmin