-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
max-width / max-height not redering correctly in pdf when height / width set in tag #417
Comments
To repoduce: https://github.com/swarl/html2pdf.git
Here max-width and max-height are applied without any conversion. So this only would work if both values are in the same aspect ratio as the picture... |
This would need to be something like this:
|
danfickle
added a commit
that referenced
this issue
Jan 14, 2020
This differs from browsers which will warp the aspect ratio in such circumstances (tested with Chrome/Safari). However, nearly all uses need the aspect ratio preserved. We can revisit this if we implement the object-fit property. Thanks a lot to @swarl who provided code which inspired the test and fix for this issue, as well as reporting the problem.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Version: 1.0.1
When in a html image tag the properties height and width are specified and css styles max-width (and max-height) is added, then the image is not rendered correctly in the pdf.
Reproduce with:
test.pdf
The text was updated successfully, but these errors were encountered: