On Sun, Feb 24, 2013 at 11:12 AM, Evan Brumley <voightkam...@gmail.com>wrote:
> Have a look at wkhtmltopdf for easy server side generation of PDFs. It's > not perfect, but it seems to be the best option out there at the moment. > I'm also hearing good things about PhantomJS, though I haven't tried it out > myself. Both options are essentially headless versions of Webkit - they > produce results that look more or less exactly the same as a web browser, > though it usually requires a fair bit of tweaking to get the proportions > and pagebreaks right. Support for javascript and SVG is very good, though > support for Flash isn't really there. They're not integrated into Django in > any way - you need to generate local html files in a temporary location and > run them using popen or similar. > > wkhtmltopdf: http://code.google.com/p/wkhtmltopdf/ > PhantomJS: http://phantomjs.org/ > Two other options that are worth looking into: * Weasyprint - An ACID2 compliant engine for converting HTML + CSS to a PDF. It's got a painful dependency chain to install, and it's got some bugs (e.g., table layouts can be a bit unpredictable), but for certain cases, it works well. * PrinceXML. Very expensive, commercially supported option. > Probably best to ignore the Django docs on this subject, incidentally. > Reportlab is great but massively time consuming, and the other options > listed in there are either dead projects or don't really do a good enough > job. I don't know if that's entirely fair. Native ReportLab (especially when using the Platypus API) can be very useful for programatically generating PDFs. Activity on xhtmltopdf has certainly slowed, but I don't know if I'd reject it outright. It only supports a limited number of CSS directives (e.g., there's on support for `float` box layouts), but inside the scope of what it supports, it works quite well. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.