I had some success using d3.js with wkhtmltopdf to do pretty much the same
thing (energy usage reports, as it happens).  It works, most of the time,
but ironing out bugs gets pretty annoying.  Sometimes things wouldn't
render (colors or something) in wkhtmltopdf, and it was basically just
"fiddle with random things" until it worked; doing things with non-pixel
dimensions is also pretty much impossible.  I also tried out PhantomJS, but
that was even worse.

Automating a real browser might work better, I didn't get to that level of
desperation though -- I got the task done "enough" and moved on.


On Wed, Nov 7, 2012 at 5:14 PM, Tim McEwan <t...@mcewan.it> wrote:

>  Hi all,
>
> I want to automate the creation of around 100 PDFs with user data and
> graphics generated by JS (charts mostly, but maybe some Raphael).  Each PDF
> is an energy bill.  The whole environment can be controlled, so it doesn't
> need to be client-side cross-platform or anything.  However, we'd like to
> be able to package it up and have others use it, so the simpler the better.
>
> I've looked at Prawn, but I'd rather not have to draw everything from
> first principles.  It seems wkhtmltopdf is a better bet so I tested it on
> highcharts.com.  It does a good job <http://cl.ly/2l1c3C083u3N>, but not
> as good as straight Safari <http://cl.ly/2Q0F0J0C022a>.  So I thought
> perhaps I'd automate a browser instead, but that may not be so 
> simple<http://stackoverflow.com/questions/11537103/how-to-handle-print-dialog-in-selenium>
> .
>
> Has anyone got any tips on the best way to go?
>
> Thanks,
> Tim
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to rails-oceania@googlegroups.com.
> To unsubscribe from this group, send email to
> rails-oceania+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to rails-oceania@googlegroups.com.
To unsubscribe from this group, send email to 
rails-oceania+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to