-
Notifications
You must be signed in to change notification settings - Fork 144
Alpine build #2
Comments
I guess I'll need to incorporate the musl changes into Qt as well, as I don't want to apply patches on the fly ... will try to look into it this weekend. |
@alloylab: are you planning to make a PR for this? |
yes I am, got behind with EOQ... just successfully compile 0.12.5 on alpine... https://git.alloylab.com/open-source/wkhtmltopdf/tags/0.12.5-070518 will submit PR on here |
Please submit PR for Qt patches first, then over here.
|
Any progress on this? |
Oh pls! I i'm doing a lot of research for a headless solution for PDF generation and wkhtmltopdf is the best until now, but I have produced a huge docker image! Alpine aproach would be perfect |
@sir-gon See my Dockerfile for this : https://github.com/Opencomp/Dockerfiles/blob/master/wkhtmltopdf/Dockerfile |
@sir-gon or feel free to use https://github.com/Surnet/docker-wkhtmltopdf |
@chdanielmueller @sir-gon But the font issue mentioned in the issue description still isn't fixedin the Surnet images, right? This makes those images only partially useful. |
@mikehaertl That's right that issue is still open. A workaround is to use fonts loaded from the web. e.g. Google Fonts @jtraulle Do you have any issues in your image with false fonts? |
@chdanielmueller I don't think so. Try it a tell me ;) |
I have not yet experienced any font issues. It is possible I may just be using my build on such a limited set of pages that I have not noticed it. I use a binary build for alpine:3.7 from https://github.com/madnight/docker-alpine-wkhtmltopdf and add fonts. My docker file is here: https://github.com/txn2/n2pdf/blob/master/Dockerfile I use this pretty heavily in my txPdf project: https://imti.co/webpage-to-pdf-microservice/ |
Any progress so far? May we help with the pr? |
No one has worked on it, so still pending. PR would definitely be welcome!
|
Is there a guide how to compile wkhtmltopdf for other platforms (alpine) and a testing guide to see if the build is working or not? |
See the README, it's relatively easy to do if you're comfortable with Docker.
The tougher part is to submit a PR for the qt changes required, will need to figure out which patches are relevant.
There's no test suite, so basic checking on a few URLs would be good before reviewing a PR.
Great to see interest, hope you do find to take it up!
|
Also, forgot about #20 by @anujith-singh -- it has the build system changes but I doubt it works because of the missing Qt patches. |
Yes @ashkulz Qt patches are missing in it |
I'm planning to release 0.12.6 in a week's time -- does someone have the capacity to work with me to integrate the Qt patches required for Alpine support? @alloylab was going to do that at one point of time -- if he or @chdanielmueller can help me integrate the patches so that they don't break something else, I'd really appreciate it 😄 |
Any updates on release 0.12.6? |
0.12.6 is released already -- an alpine version will only happen for 0.12.7. |
@ashkulz The file linked below is a Dockerfile for alpine:10 which builds 0.12.6 With alpine:11 and up we have an issue that we are not able to build without specifically setting g++ and stdlibc++ to use the version from alpine:10. |
@chdanielmueller that's a common problem (affecting Ubuntu 20.04 and ArchLinux as well) -- I'll be solving that with a proper fix in Qt, the My main concern is integrating the other patches in https://github.com/Surnet/docker-wkhtmltopdf/tree/master/conf -- I'd like to understand why each one is required, as they shouldn't cause a regression for some other platform. Do you have some script/process that you use for testing the resulting binary, so I can confirm if the patch is required at compile time or at runtime and adapt accordingly? |
I did not include any automated tests. The patches are being applied here: |
any update for this issues ? look like is not patched with qt |
@darmawan01 not really, I haven't had time to integrate the musl patches into patched Qt. |
i really need for this qt support in alpine. when the 12.7 will release with alpine build patched qt ? |
Hey to get this working in the mean time I used some of the dependencies mentioned in https://github.com/RoseRocket/docker-alpine-wkhtmltopdf-patched-qt
This now works for me on a base It took a day of wondering around the internet to get this to work but it does now :) Thanks @ashkulz for this librairie, it is awesome :) |
@ashkulz, would be helpful to hear your view on this approach. Am I opening a can of worms using this for a production env? Is it best to wait for .7 release? It would be for creating a pull request on a Linux Server image to resolve this issue: linuxserver/docker-bookstack#80 |
@Maggie0002, issue I faced that Chinese text is not being rendered without wqy-zenhei package. |
Anyone managed to achieve QT5 Webkit compatibility? I'm wondering there is a docker image / guide or anything out here. Thanks! |
Any updates on this? |
Not really, haven't had the time to investigate the required Qt patches. |
I would like to share some info which may help those who are still struggling with font issues. I'm not sure where the source of problem but it seems that it depends a lot on configuration of fontconfig. I have following test file:
With docker image from https://github.com/Surnet/docker-wkhtmltopdf, if no fonts are installed, the pdf will have both lines with "Arial Narrow", which is reasonable. But if I install Arial in OS, the pdf will have both lines in Arial. Replace Arial with other font, it will have both lines in that font, ignoring completely the font-face in css. Now if I extract the package I also tested with ubuntu:focal, it had the same issue without the package |
@huycn that sounds like more a fontconfig issue with the above docker image and not wkhtmltopdf? Thanks for the information, though! |
Sorry for asking. But this could be very useful for what I am currently working on (alpine images with wkhtmltopdf for amd and arm processors), so... Is there any update on this? 😅 |
If you want your pdf look pixel perfect as in browser, just use a browser and some testing framework. Here is an example how to do this with puppeteer' https://futurestud.io/tutorials/node-js-create-a-pdf-from-html-with-puppeteer-and-handlebars |
I already have existing applications that are using wkhtmltopdf. The only thing is that I would like to have it inside my alpine images for easier deployment and maintenance in general. So switching to another pdf renderer isn't really an option 😅 |
I don't think there is a up-to-date binary therefore also no image. If it would be it would be here. But you might be able to find older versions, just search for it, I used to use one myself. |
I think there's a few docker images linked above, I've yet to evaluate the patches 🤷♂️ |
I'm using this and it doesn't seem to support JavaScript |
There's already a (docker based) build for alpine over here:
https://github.com/Surnet/docker-wkhtmltopdf
The build setup could be copied as a starting point.
It basically works - but has issues with some fonts not being rendered correctly (See Surnet/docker-wkhtmltopdf#1). We've boiled that down to:
/cc @chdanielmueller Maybe you can contribute something here? It would be awesome to have an "official" alpine build of wkhtmltopdf and you seem to already have solved most of the hurdles.
As much as I'd like to help, I have not looked into the build process at all and I'm not really an expert here.
The text was updated successfully, but these errors were encountered: