0

I'm using WickedPDF to generate PDF's from views in a Rails 3.2 app. I'm also using Twitter Bootstrap.

My pdfs contain images, to which I've applied class: 'img-circle'.

When I view the PDF as html (render pdf: "My PDF", show_as_html: true) the images are rendered as circles.

However, when viewing as a PDF the images are square.

Why are the image radii not displayed in the PDF version?

Andy Harvey
  • 12,333
  • 17
  • 93
  • 185

1 Answers1

2

The version of QT that wkhtmltopdf uses for the headless browser did not support this until very recently:

Here are bugs filed against the wkhtmltopdf and QT projects:

https://code.google.com/p/wkhtmltopdf/issues/detail?id=540

https://bugs.webkit.org/show_bug.cgi?id=56314#c6

I'm not sure if the latest wkhtmltopdf binaries are built against a new enough QT, but I'd download the very latest and test it out first:

http://wkhtmltopdf.org/downloads.html

If that still doesn't work, here's how to build a newer QT and compile a new wkhtmltopdf binary:

http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/

Unixmonkey
  • 18,485
  • 7
  • 55
  • 78
  • thanks for this detailed answer. will give this a go and report back – Andy Harvey May 31 '14 at 04:27
  • Thanks @unixmonkey, this worked perfectly. I had been using the `wkhtmltopdf-binary`. I've replaced this with the latest wkhtmltopdf binary from the link you provided above, and with reference to these instructions at the following link. I did not need to rebuild QT, and everything works fine! http://stackoverflow.com/questions/5013955/problem-implementing-wicked-pdf-on-heroku/16577677#16577677 – Andy Harvey Jun 01 '14 at 00:06