pallymore / wkhtmltopdf-binary-edge

this is forked from tolgap/wkhtmltopdf-binary .
MIT License
74 stars 33 forks source link

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

Open stevebutler2210 opened 6 years ago

stevebutler2210 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

I have the same error. no solution yet

martinbjeldbak commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Hi. This could be addressed by #16

jefmathiot commented 5 years ago

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

alvarofernandoms commented 5 years ago

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

Thanks, @jefmathiot! Same here.

kavitakanojiya commented 5 years ago

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.

leifcr commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Hello Guys! We have any update about that?

pallymore commented 4 years ago

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 commented 4 years ago

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

This worked for me ! :)

mrobbizulfikar commented 3 years ago

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 commented 2 years ago

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