bersling
bersling

Reputation: 19312

Wkhtmltopdf cuts off images

So I have had my share of problems with images and wkhtmltopdf. I am trying to convert this html (jsfiddle), to a pdf using wkhtmltopdf (0.12.2.1). However, wkhtmltopdf crops my potato.

Does anyone have an idea how I can make it stop cropping my potato?

I already applied a hack to the html in order to get images to display properly. After extensive research I found that wkhtmltopdf doesn't like clip-path, so I replaced all clip-path's with clip-path="none". Then my images worked, until now that I try to text-align:center them.

Any suggestions are greatly appreciated.

enter image description here

Upvotes: 3

Views: 1837

Answers (1)

justinkredible56
justinkredible56

Reputation: 66

When I found this I hoped I would find the answer to this very issue.

I found the answer at the bottom of this question: wkhtmltopdf + mixed photo colors

Check out @catchdave's response almost 4 years after the OP.

TL&DR, for whatever reason, you need to add opacity: .99 to your image css.

Hope this helps others as I wasted 2 full days debugging this issue before I found the solution!

Upvotes: 2

Related Questions