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

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

Open
stevebutler2210 opened this issue Sep 20, 2018 · 21 comments
Open

Comments

@stevebutler2210
Copy link

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.

@martinbjeldbak
Copy link

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.

@stevebutler2210
Copy link
Author

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

@SalvesTestservices
Copy link

I have the same error. no solution yet

@martinbjeldbak
Copy link

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

@leifcr
Copy link

leifcr commented Oct 3, 2018

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

@benoitongit
Copy link

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?

@leifcr
Copy link

leifcr commented Oct 8, 2018

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).

@kewubenduben
Copy link

Hi. This could be addressed by #16

@jefmathiot
Copy link

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

@alvarofernandoms
Copy link

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

Thanks, @jefmathiot! Same here.

@kavitakanojiya
Copy link

kavitakanojiya commented Mar 18, 2019

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.

@leifcr
Copy link

leifcr commented Mar 26, 2019

@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.

@pallymore
Copy link
Owner

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!

@iamhimateja
Copy link

iamhimateja commented Sep 17, 2019

@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.

@LizBayardelle
Copy link

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'

@pallymore
Copy link
Owner

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

@rafaeldev
Copy link

Hello Guys! We have any update about that?

@pallymore
Copy link
Owner

pallymore commented Nov 28, 2019

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.

@ananthsathvick
Copy link

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

This worked for me ! :)

@mrobbizulfikar
Copy link

mrobbizulfikar commented Mar 4, 2021

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

@kazmin
Copy link

kazmin commented Apr 30, 2022

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

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