Comments (17)
Hi @tsadiq,
Could you maybe add two examples of PDFs (one with failure + one of what you would expect)?
I'm currently unaware of any issues in that regard. But maybe I can help you if I see the issue.
Thanks,
Daniel
from docker-wkhtmltopdf.
Sure, here they are. I just noticed while uploading them that the file made with the patched version is only 25kb in weight, while the other is above 300kb. Could it be that the css file wasn't downloaded? That could explain the lack of proper rendering (and the absence of QUrl error message 🤔)
wk-patched.pdf
wk-unpatched.pdf
from docker-wkhtmltopdf.
I don't know how the HTML for your file looks, but there are some background-colors in there.
Therefore I suppose the CSS gets loaded.
Maybe there is an issue with the page width or linebreaks.
Does the page look okay if opened in a browser?
Maybe you could set the wkhtmltopdf setting "disable-smart-shrinking" to true.
This helped with layout issues for my PDFs.
from docker-wkhtmltopdf.
I did try but the result is the same, it just renders bigger than before. That was a nice try tho, thanks for the idea! :D
from docker-wkhtmltopdf.
I ended up inlining all the css libs inside my html and i don't have any error with the unpatched version anymore so i guess this will close the topic for now... Until i need actual footers, then i think i'll give another try!
But for reference, the patched version still can't render my html properly, even with inlined css. That's pretty unnerving.
from docker-wkhtmltopdf.
Perhaps if you could share the HTML and CSS, others can identify what's going on?
from docker-wkhtmltopdf.
I can, if you feel like having a try at it ^^ I took this out of my docker /tmp, i just renamed it to .txt because github doesn't like html attachments
origin.txt
Also, here is the pdf i made using the above file by using the full docker image i built from this repo
result.pdf
The image is obviously missing but i don't think this is an issue
from docker-wkhtmltopdf.
I'm going to keep the issue open. Maybe I (or someone else) has time to take a look at it.
from docker-wkhtmltopdf.
As you see fit ^^ I might come back to it sooner or later (as i said, footers 👌) but in the meantime i can't help but thinking something went wrong during the image build and my binary is somehow broken.
from docker-wkhtmltopdf.
@tsadiq Actually I don't understand why you're building the image yourself when you could just copy the binary?
from docker-wkhtmltopdf.
Anyway, I confirm that I can reproduce the problem with something like this:
$ docker run --rm -v "$HOME/Downloads/test:/root/test" --name wkhtmltopdf surnet/alpine-wkhtmltopdf:3.9-0.12.5-small 'file:///root/test/test.html' /root/test/test.pdf
from docker-wkhtmltopdf.
FWIW, it does render correctly with athenapdf:
$ docker run --rm -v "$HOME/Downloads/test:/converted" --name athenapdf arachnysdocker/athenapdf athenapdf /converted/test.html
But that's ~100% slower.
from docker-wkhtmltopdf.
@teohhanhui probably because i like to make things complicated, i guess ¯\ _(ツ) _/¯
from docker-wkhtmltopdf.
@tsadiq I was able to at least get a "better" layout by removing the legacy display:-webkit-box;
and display:-webkit-inline-box;
res.pdf
Maybe there are other settings like this in your css which cause the layout to be broken.
from docker-wkhtmltopdf.
Closing this issue for now as it does not seem to be an issue with the image itself but css styles.
@tsadiq Please keep in mind that wkhtmltopdf uses the webkit engine and therefore legacy tags can cause issues.
from docker-wkhtmltopdf.
Oh hey i missed these answers sorry ^^ I think i'ma rework this whole html file with very basic html /css because that subcontractor did a serious pile of crap here. Thanks again for your time 👌
from docker-wkhtmltopdf.
Hey, just to let you know, with clean css and reworked html, things are much better and i can use the binary of your last version with footers and pages!
Thanks for your work and your time 👍
from docker-wkhtmltopdf.
Related Issues (20)
- font size issue for Thai language HOT 1
- Any chance guide to get it working on Apple Silicon? HOT 14
- Progress stuck on 10% when running on Mac HOT 3
- New features of JS HOT 3
- Release update for alpine:3.16 HOT 3
- Some CSS features are not working HOT 1
- problem with aspnet:6.0-alpine base image HOT 2
- docker file nodejs HOT 1
- Symbols not found: alpine-wkhtmltopdf with PHP-FPM 8.2 HOT 2
- Absence of page options HOT 1
- /bin/sh: wkhtmltopdf: not found HOT 4
- Getting no such file exist error while building docker with file Dockerfile_3.16.0-0.12.6-small
- alpine support wkhtmltopdf-dev HOT 1
- install into go alpine dockerfile HOT 1
- Doesnt work with node js wrapper? HOT 2
- Alpine 3.19 HOT 3
- Chinese and Japanese characters not printing in 3.16.2-0.12.6-full HOT 1
- Document the use of libssl3 for other images based on alpine3.19 in readme HOT 1
- Help to build a docker image for net core apps HOT 1
- Alpine 3.20 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-wkhtmltopdf.