Sunday, February 24, 2013

Re: Saving browser output as pdf

On Mon, Feb 25, 2013 at 12:18 AM, Mark Furbee <markfurbee@gmail.com> wrote:
>> Django docs (pretty turse):
>> https://docs.djangoproject.com/en/dev/howto/outputting-pdf/
>>
>> From ReportLab site:
>> http://www.reportlab.com/software/documentation/
>>
>> Here's a decent quick tutorial:
>> http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/
>>
>> Note that what you are proposing is to create an HTML version of the report
>> and a separate PDF version using ReportLab. Otherwise, if you want to make
>> what would be an HTML report download as a PDF document, use @Mike's
>> solution.
>>
>> Good Luck,
>>
>
Indeed Mark's solution is more elegant than mine if you want to use the
same view as both html or pdf depending on a switch.
My solution creates two independend views with the same arguments, one
of them produces always html, and the other pdf. I wanted it that way
since these two views are aesthetically different.
Depending on your design, choose the one most comfortable.

--
--------------------------------------------------------------
Nick Apostolakis
e-mail: nickapos@oncrete.gr
Web Site: http://nick.oncrete.gr
--------------------------------------------------------------


--
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+unsubscribe@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.

No comments:

Post a Comment