walle / gimli

Utility for converting markup files to pdf files
https://github.com/walle/gimli
MIT License
538 stars 44 forks source link

Image with height as % doesn't display images #20

Closed spenrose closed 12 years ago

spenrose commented 12 years ago

The following url doesn't have an image in the PDF

<img src="http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png" height="50%" />

but if you use a height in pixels it works

<img src="http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png" height="100px" />
walle commented 12 years ago

Sorry for the late response, and tanks for reporting.

I have tested this quickly with this textile

h1. Test

!http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png!

!{width:100%;}http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png!

!{height:20%;}http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png!

And you are right, the height one doesn't get displayed. I wonder if this is a limitation in wkhtmltopdf? Seems like it only affect height, could be that it doesn't know what to calculate the percentage from, since the with percent works.

Sorry, don't have a solution for this at this moment. I'll have to look it over some more.

spenrose commented 12 years ago

There is no hurry as I just set the height using pixels. I just wanted to let you know.