[reportlab-users] Problem generating PDF from Django/Python HTML Template

Andy Robinson andy at reportlab.com
Tue Oct 10 13:03:19 EDT 2006


> That's probably coming from a Cheetah SkeletonPage.tmpl.  Are you
> calling this from inside a Cheetah template?  Why?  Why not just call
> this directly and skip the template?  You can't use any HTML anyway when
> you are return this.  The output must consist of NOTHING other than your
> PDF content.

Specifically, you have only one call to drawString.  So, you'll get a 
single line of text (probably raw HTML) starting at (0, 820) and 
trailing off the right edge of your PDF page into infinity - unless your 
intent is to generate one short string from the template.

Our library does not convert HTML to PDF.  You need to write the Python 
code to arrange the lines or paragraphs you want on the PDF page(s).

<salesPitch>
Or, you can license Report Markup Language and use Django/Cheetah/preppy 
or some other templating system to create RML, and call a one-liner to 
convert to HTML. We're doing lots of PDFs out of Django right now. Our 
prices start low for low-volume apps - just email me if you'd like to 
discuss this...
</salesPitch>

Best regards,


Andy Robinson


More information about the reportlab-users mailing list