Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.03 KB

README.md

File metadata and controls

36 lines (25 loc) · 1.03 KB

Open source implementation of RML (Report Markup Language) from ReportLab

Build Status

RML User Guide (or beginner tutorial)

Not all tags are implemented, but the main ones are. List of implemented tags

Install

pip install trml2pdf

Examples

Create a PDF file:

import trml2pdf
print trml2pdf.parseString(open('file.rml','rt').read())

If you are using this for Django you can dynamically create an .rml file with the template system and then render it.

from django.template.loader import get_template
from django.template.context import Context
import trml2pdf

data = {'key1': 'foo'}
template = get_template('template.rml')
context = Context(data)
xmlstring = template.render(context)
pdfstr = trml2pdf.parseString(xmlstring)