README.md in imgkit-1.3.3 vs README.md in imgkit-1.3.4

- old
+ new

@@ -1,31 +1,6 @@ -# Patch Intention -To overcome the lack of support for --user-style-sheet option by wkhtmltoimage 0.10.0 rc2 as reported here http://code.google.com/p/wkhtmltopdf/issues/detail?id=387 - - require 'imgkit' - require 'restclient' - require 'stringio' - - url = 'http://domain/path/to/stylesheet.css' - css = StringIO.new( RestClient.get(url) ) - - kit = IMGKit.new(<<EOD) - <!DOCTYPE HTML> - <html lang="en"> - <head> - <meta charset="UTF-8"> - <title>coolest converter</title> - </head> - <body> - <div class="cool">image kit</div> - </body> - </html> - EOD - - kit.stylesheets << css - # IMGKit Create JPGs using plain old HTML+CSS. Uses [wkhtmltoimage](http://github.com/antialize/wkhtmltopdf) on the backend which renders HTML using Webkit. Heavily based on [PDFKit](http://github.com/jdpace/pdfkit/). @@ -126,9 +101,35 @@ :type => "image/png", :disposition => 'inline') end This allows you to take advantage of rails page caching so you only generate the image when you need to. + +## --user-style-sheet workaround +To overcome the lack of support for --user-style-sheet option by wkhtmltoimage 0.10.0 rc2 as reported here http://code.google.com/p/wkhtmltopdf/issues/detail?id=387 + + require 'imgkit' + require 'restclient' + require 'stringio' + + url = 'http://domain/path/to/stylesheet.css' + css = StringIO.new( RestClient.get(url) ) + + kit = IMGKit.new(<<EOD) + <!DOCTYPE HTML> + <html lang="en"> + <head> + <meta charset="UTF-8"> + <title>coolest converter</title> + </head> + <body> + <div class="cool">image kit</div> + </body> + </html> + EOD + + kit.stylesheets << css + ## Note on Patches/Pull Requests * Fork the project. * Setup your development environment with: gem install bundler; bundle install