Coder Social home page Coder Social logo

Comments (7)

estherbouquet avatar estherbouquet commented on May 18, 2024 1

I'm going to try and I'll let you know. thanks!
Yes I install wkhtmltopdf by using apt-get install wkhtmltopdf

from imgkit.

jarrekk avatar jarrekk commented on May 18, 2024 1

Yes I install wkhtmltopdf by using apt-get install wkhtmltopdf

I am not sure if you install the package for raspbian pi platform, there are multiple packages in one release. https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.5

from imgkit.

estherbouquet avatar estherbouquet commented on May 18, 2024 1

hi again! I think I've found the solution after all and you led me to this, so thank you so much!

You were right, it was coming from the wkhtmltopdf that was installed when I first did (months ago) sudo apt-get install wkhtmltopdf. Definitely a wrong move. I realised that when I did a wkhtmltopdf -V after installing wkhtmltox_0.12.5-1.stretch_amd64.deb: it was not using this new version.
I also found out about amd64 and i386: I didn't know Stretch could be rather 64bit or 32. In my case, using uname -m it gave me back armv7l which is... 32bit. The amd64 version that I downloaded was completely useless.

So I did sudo apt-get purge --auto-remove wkhtmltopdf to get rid of the package and its dependencies and then went on the wkhtmltopdf release page to copy the link for the Debian 9 (Stretch) raspberrypi architecture.

I followed the instructions of your init.sh file, replacing https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb with the link I've just copied for Stretch.

When I did wkhtmltopdf -V to see if I had the right version this time, it told me that it couldn't find any file or folder. With which wkhtmltopdf I was able to see that I installed it in /usr/local/bin/ instead of /usr/bin/ so I moved the file back using mv /usr/local/bin/wkhtmltopdf /usr/bin.
wkhtmltopdf -V worked like a charm this time and returned wkhtmltopdf 0.12.6 (with patched qt).

Full of hope, I tried wkhtmltoimage inputfile outputfile and had a new error: Warning: Blocked access to file which was easily solved by doing wkhtmltoimage --enable-local-file-access inputfile outputfile as explained here. Then, when I tried adding xvfb-run just before this line, I had no error and my images were finally pictured! 🥳

I tried to do the same in my python code by doing:

options={
  'enable-local-file-access': '', 
  'xvfb':""
}

imgkit.from_file(inputfile, outputfile, options=options) 

And it also worked 😭 I can't believe it!
Thanks again for your support and I promised, I'll stop cursing xvfb next time haha

from imgkit.

jarrekk avatar jarrekk commented on May 18, 2024

@estherbouquet thanks for the question.

libEGL warning: DRI2: failed to create any config
libEGL warning: DRI2: failed to create any config

Looks this error is about the raspberry pi, can you try on another environment like an Ubuntu server?

from imgkit.

estherbouquet avatar estherbouquet commented on May 18, 2024

Unfortunately I would not know how to do it, my knowledge is limited, sorry.

from imgkit.

jarrekk avatar jarrekk commented on May 18, 2024

How about running wkhtmltoimage directly and check the result? Did you install wkhtmltopdf for raspberry pi platform?

from imgkit.

estherbouquet avatar estherbouquet commented on May 18, 2024

How about running wkhtmltoimage directly and check the result? Did you install wkhtmltopdf for raspberry pi platform?

So I tried to run wkhtmltoimage in my terminal and no problem, the pictures are here even though I have libEGL warning: DRI2: failed to authenticate showing up. When I do xvfb-run wkhtlmtoimage in my terminal, no picture are rendered though.

After trying that, I reinstalled the wkhtmltopdf package for the stretch version (wkhtmltox_0.12.5-1.stretch_amd64.deb) instead of bionic as in your readme and no luck there neither. Still no picture and still the same error with libEGL and DRI2 anytime I use xvfb with imgkit or xvfb-run with wkhtmltoimage.

Do you think it's because I need to give a display number to xvfb somewhere in order for the raspberry to know which display screen to use to render the pictures?

from imgkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.