barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.74k stars 972 forks source link

Images are getting squeezed #823

Closed abhishekunic closed 2 years ago

abhishekunic commented 3 years ago

image as you can check in image, on first page Images are getting squeezed, but not on second page

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

loekwetzels commented 2 years ago

@abhishekunic have you ever solved this? Running into the same issue

loekwetzels commented 2 years ago

Found the solution!

This happens when images are inside tables. Solved using:

td img {
  max-width: auto;
}

Reference: https://github.com/dompdf/dompdf/issues/1448#issuecomment-337337244

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.