How to create a simple PDF

6 views
Skip to first unread message

conrad22

unread,
Jan 15, 2007, 1:29:58 PM1/15/07
to Django users
Please could anyone give me a quick how to on PDF outputting. I've
looked at the official documentation around Report Lab, but remain
clueless.
If you have a simple model: eg a list of contacts, how do you 'draw'
the PDF?
With thanks in advance

prashanth

unread,
Jan 15, 2007, 2:00:42 PM1/15/07
to django...@googlegroups.com
> -

u want to create PDF from what? if u are going to do a fresh work i
suggest u to use latex. I use it for presentation and many more
work..... u have the option of creating a pdf

--
regards,

|Prashanth|

http://munichlinux.blogspot.com

Jacob Kaplan-Moss

unread,
Jan 15, 2007, 4:58:09 PM1/15/07
to django...@googlegroups.com
On 1/15/07 12:29 PM, conrad22 wrote:
> Please could anyone give me a quick how to on PDF outputting. I've
> looked at the official documentation around Report Lab, but remain
> clueless.

http://www.djangoproject.com/documentation/outputting_pdfs/

Jacob

Chris Moffitt

unread,
Jan 15, 2007, 6:19:18 PM1/15/07
to django...@googlegroups.com
I convert text to PDF using the trml2pdf tool here -
http://www.openreport.org/index.py/static/page/trml2pdf

Here's a view I call to create 1 of 3 PDF documents
http://satchmo.python-hosting.com/file/trunk/satchmo/shipping/views.py

The PDF templates (in rml format) are stored here -
http://satchmo.python-hosting.com/browser/trunk/satchmo/templates/pdf/

This setup seems to work pretty well for me.

Good luck,
Chris

Kenneth Gonsalves

unread,
Jan 15, 2007, 9:08:03 PM1/15/07
to django...@googlegroups.com

On 16-Jan-07, at 3:28 AM, Jacob Kaplan-Moss wrote:

>> Please could anyone give me a quick how to on PDF outputting. I've
>> looked at the official documentation around Report Lab, but remain
>> clueless.
>
> http://www.djangoproject.com/documentation/outputting_pdfs/

i found the solution very simple - first learn to use report lab.
Then all will be clear. And given the opacity of report lab
documentation, that is not very easy

--

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/


tonemcd

unread,
Jan 16, 2007, 5:17:18 AM1/16/07
to Django users
I was going to suggest looking at a Java-based system called Jasper
reports, which we got into because we found ourselves spending too much
time writing ReportLab scripts to generate PDFs (Jasper has a wysiwyg
interface and connects to databases directly).

However, seeing Chris' email reminded me of RML, which was designed by
the ReportLab guys and *much* easier to use than ReportLab itself. We
looked into that and were very interested, but the licencing fee was
too high for us (the RL guys do a lot of work for finance houses, and
they have plenty of cash).

I don't think TinyRML is as powerful as RML, but you can't beat the
price!

Conrad, I think you should definitely look at Chris' solution - we've
done a *lot* of work in ReportLab and as Kenneth says, it's not
trivial, whereas Chris has made it all look easy ;) I particularly like
the fact that the PDF templates (in RML format) are django templates -
it reinforces the idea that django can do stuff other than HTML.

Cheers,
Tone

conrad22

unread,
Jan 17, 2007, 6:57:52 AM1/17/07
to Django users
Ok, thanks everyone...I am looking at all of the suggestions above, but
it does look like Chris's solution is a good one - being able to
separate the Django logic that you already have, from the templates,
and from the PDF generation has got through to even my limited
understanding.

A million thanks for eveybody's help...I'll be back if (or should it be
when?!) I get stuck.

Rubic

unread,
Jan 17, 2007, 11:37:42 AM1/17/07
to Django users
> I don't think TinyRML is as powerful as RML, but you can't beat the price!

Is TinyRML being actively maintained?

Chris Moffitt

unread,
Jan 17, 2007, 12:09:00 PM1/17/07
to django...@googlegroups.com

> Is TinyRML being actively maintained?

Unfortunately, it doesn't look like there's been any activity for about 1
year. I haven't tried getting in touch with the maintainer to see. For
my limited use it appears to work fine.

-Chris

Reply all
Reply to author
Forward
0 new messages