Woah, thanks for all the awesome info. These options will keep me going for a
while. :)
On Thursday, 8 November 2012 at 10:36, Rufus Post wrote:
> I have had great success with wkhtmltopdf (except that it at ALL the memory
> with a gradient on body).
>
> For some reasons it's a little sketchy with certain css, word-spacing breaks
> everything @font-face needs to be an exact format etc etc.
>
> So if it does not look like Safari you will need to target it with media
> queries to fix:
>
> @media print {
> .actions {
> display: none;
> }
> }
>
> @media (min-width: 768px) and (max-width: 979px) {
>
> }
>
> This is cool:
>
> config.middleware.use PDFKit::Middleware, print_media_type: true
>
> /reports/1.pdf
>
> Also someone has put the binary in a gem:
>
> https://rubygems.org/gems/wkhtmltopdf-binary
>
> As far as packaging up for others, no dice. As views need css tweaks and
> media queries.
>
> phantom.js is awesome, but I don't know how to generate PDFs with it …….
>
>
> On 07/11/2012, at 11:25 PM, Bruce Wang <[email protected]
> (mailto:[email protected])> wrote:
> > Hi Tim,
> >
> > Have you try phantom.js (http://phantomjs.org/)? Since your source is js,
> > it seems to be a perfect fit.
> > https://github.com/ariya/phantomjs/wiki/Screen-Capture (search for
> > rasterize.js)
> >
> > It's actually a headless WebKit with JavaScript API, much better and faster
> > than Selenium.
> >
> > HTH.
> >
> > Cheers,
> > Bruce
> >
> >
> >
> > On Wed, Nov 7, 2012 at 5:14 PM, Tim McEwan <[email protected]
> > (mailto:[email protected])> 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 (http://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 [email protected]
> > > (mailto:[email protected]).
> > > To unsubscribe from this group, send email to
> > > [email protected]
> > > (mailto:rails-oceania%[email protected]).
> > > For more options, visit this group at
> > > http://groups.google.com/group/rails-oceania?hl=en.
> >
> >
> >
> >
> > --
> > simple is good
> > http://brucewang.net (http://brucewang.net/)
> > http://twitter.com/number5
> >
> >
> > --
> > 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 [email protected]
> > (mailto:[email protected]).
> > To unsubscribe from this group, send email to
> > [email protected]
> > (mailto:[email protected]).
> > 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 [email protected]
> (mailto:[email protected]).
> To unsubscribe from this group, send email to
> [email protected]
> (mailto:[email protected]).
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.