wicked_pdf renders a tiny pdf image - ruby-on-rails

I have added wicked_pdf to my rails app with default options following the readme file (with the deviation being that I installed wkhtmltopdf via the osx installer).
When I render my page with the .pdf?debug=true option, the page looks exactly as it should.
Then when I leave out the debug option, it produces a PDF with a tiny version of the page. Like 1/16 of the size.
I use no options or configuration. Where am I going wrong? Where should I be looking?

Solved it by changing the wkhtmltopdf version from 12.4 to an earlier version.
After a lot of googling others have reported a similar bug with version 12.4 on OSX.
Maybe the answer here saves someone else a few hours of googling.

It worked for me by changing the version to
gem 'wkhtmltopdf-binary', '~> 0.12.3.1'
reference here

Related

pnotify-rails works but icons not visible

I am new to ruby on rails.
In my web app I used pnotify-rails, its working fine but icons are not visible, instead its showing some unwanted symbols.
how to resolve this
I had same issue, when I checked pnotify-rails version.
and than searched for the latest version of pnotify-rails,
which is 3.0.0, So updated the gem.
All you need is to update this gem by runnig
bundle update pnotify-rails
Hopefully, there will be no issue with icons.

Seer working in everything but latest IE browsers

I'm maintaining an old rails 2.x app that is slated for retirement after this summer.
It uses the Seer gem to create a simple barchart and has always worked like a champ in every browser.
Now, however, it won't work in the most recent versions of IE. The code itself hasn't changed in two years. It works in every other browser.
It WILL work in IE in compatibility mode. The javascript is sent to the browser but the browser won't render it.
Seer is an old gem and this is an old app....I understand this is a bit of a hail mary.
Anyone else run into this problem? I would post the code but I believe this is one of those questions that will either be instantly recognizable to someone if they've seen it before.
Thanks!
EDIT: the gist of the js is here: https://gist.github.com/crowell256aa/9200487
That gem uses the old and deprecated "barchart" package for drawing charts. Since that package predates the arrival of IE9, I suspect that it is trying to create VML code in IE 9+, which is probably the cause of the code not working. The fix for this is to use the modern "corechart" package instead.

discrepancy between development and production pdf generated

I've Iterated over the creation of a PDF with data in my RoR application. I am using wkhtmltopdf 0.9.9 locally and trying to use wkhtmltopdf-binary (0.9.9.1) gem on heroku.
My PDF looks exactly the way I want it to look locally but it looks like the heroku version is a zoomed out version of the local version effectively making the page on heroku left align when the development version is perfectly centered.
I'd like my production version to look exactly like my development version so that I don't have to iterate on my heroku instance.
Any help is appreciated!
I had the same problem, but setting DPI, while generating pdf via wkhtmltopdf, solved the problem.
--dpi 100

Font rendering issues with wkhtmltoimage

I have a Rails app which uses wkhtmltoimage to render an image. The font used in the image is Lucida Grande, included via inline data-uris. On my local Mac everything works just fine, but on the remote server (Ubuntu 12.10) the font just looks weird. Both are using wkhtmltoimage 0.10.0 rc2.
The left one is generated on my Mac, the right one on the Ubuntu server.
Any ideas whats going on?
Unfortunately I haven't found a solution for this problem. But today I was lucky enough to find a workaround! :)
After reading Thomas Fuchs' Embedding Canvas and SVG charts in emails I went the radical way and completely replaced wkhtmltoimage with PhantomJS. I also used his gist to install some dependencies. And here are the results:
wkhtmltoimage local & remote:
PhantomJS local & remote:
Though there are still small differences, PhantomJS does its job quite good! So I will use this for now, and close this question :)

jazz_hands gem breaks history in rails console

I've started using jazz_hands to make my Rails console more useful, but now line/history editing is broken. When I run over the end of the line (ie, wrap), or use up arrow to go into history, the output is garbled.
Terminal settings are fine for everything else, Ubuntu 12. Any ideas? I'm hoping it's something simple and I'm not the first developer to bump into this, but there's nothing in the FAQ, or in the various related Gems (pry etc), and I'm loathe to raise a bug on the project until I check this isn't a well known issue.
It's fixed in the latest update, but here's a few workarounds if for some reason you can't update.
https://github.com/nixme/jazz_hands/issues/1

Resources