Skip to content

RML Tutorials and Examples

Image

We have a public Mercurial repository which you can browse online and clone 5 mini projects locally to play with. Our full test suite of RML examples is also included

To pull this down, run this command,

hg clone https://hg.reportlab.com/hg-public/rlextra-examples/

then look at the README.

If you are stuck behind a firewall, our Mercurial repo has a link download a zip file

https://hg.reportlab.com/hg-public/rlextra-examples/archive/tip.zip

1) rml_tests/ - Our full test suite of RML examples.

2) invoice/ - A simple JSON to PDF project which is the standard way ReportLab deploys a solution which accepts JSON input and produces PDF output.

3) product_catalogue/ - An XML product listing converted to a fully customisable PDF in seconds.

4) graphic_card/ - This shows the use of reportlab/graphics to make a very simple "image card",

5) fundfacts/ - A Django project with some sample data and a landscape PDF report showing the techniques to create tables, charts and various types of content in our framework.

6) retrofitzero/ - A complex JSON to PDF project with a custom Diagra chart and PageCatcher examples.

7) long document/ - Shows how to create longer flowing documents with tables of contents and variable chapter headings.

8) hansard/ - Content from the UK Parliament's digital archive, formatted consistently with the online style, with code to pull down and format any debate.

RML Samples

This page illustrates all the RML files in our ReportLab rml2pdf test suite. This page will be updated daily from our svn repository and will therefore include any new features of RML. The files listed below are the same as our rlexra/rml2pdf/test directory and the RML user guide to get the full picture on how to use RML effectively.

Side by side

Below are some side by side RML and the respective PDF output. For more examples, please use the download table.

test_000_simple.rml test_000_simple.pdf
test_006_barcodes.rml test_006_barcodes.pdf
test_044_codesnippets.rml test_044_codesnippets.pdf

Download table

Please note that from time to time some of the test suite may fail as we are subjected to upgrade or modify our rml2pdf engine for improvements.

RML PDF OUTPUT
test_000_catchforms.rml test_000_catchforms.pdf
test_000_complex.rml test_000_complex.pdf
test_000_simple.rml test_000_simple.pdf
test_000_simple_e128.rml test_000_simple_e128.pdf
test_000_simple_e256.rml test_000_simple_e256.pdf
test_000_simple_e40.rml test_000_simple_e40.pdf
test_000_simpleb.rml test_000_simpleb.pdf
test_001_cmbox.rml test_001_cmbox.pdf
test_001_hello.rml test_001_hello.pdf
test_001_hello_dg.rml test_001_hello_dg.pdf
test_001_hellob.rml test_001_hellob.pdf
test_001_hellocm.rml test_001_hellocm.pdf
test_001_imagereflect.rml test_001_imagereflect.pdf
test_002_paras.rml test_002_paras.pdf
test_002_paras_index.rml test_002_paras_index.pdf
test_002_paras_space.rml test_002_paras_space.pdf
test_003_frames.rml test_003_frames.pdf
test_004_fpt_templates.rml test_004_fpt_templates.pdf
test_004_templates.rml test_004_templates.pdf
test_005_fonts.rml test_005_fonts.pdf
test_006_barcodes.rml test_006_barcodes.pdf
test_007_forms.rml test_007_forms.pdf
test_008_tables.rml test_008_tables.pdf
test_009_splitting.rml test_009_splitting.pdf
test_010_linkURL.rml test_010_linkURL.pdf
test_011_keepwithnext.rml test_011_keepwithnext.pdf
test_012_simpletoc.rml test_012_simpletoc.pdf
test_014_graphics.rml test_014_graphics.pdf
test_016_orientations.rml test_016_orientations.pdf
test_016_pagecatcher.rml test_016_pagecatcher.pdf
test_016_pdf_broken_error.rml Has not been generated
test_016_pdf_missing_error.rml Has not been generated
test_017_outlines.rml test_017_outlines.pdf
test_018_toc_outline.rml test_018_toc_outline.pdf
test_019_relativeframes.rml test_019_relativeframes.pdf
test_020_dynamic.rml test_020_dynamic.pdf
test_021_figures.rml test_021_figures.pdf
test_022_paras_oas.rml test_022_paras_oas.pdf
test_023_ttfonts.rml test_023_ttfonts.pdf
test_024_indents.rml test_024_indents.pdf
test_025_pto.rml test_025_pto.pdf
test_025_set_top_flowables.rml test_025_set_top_flowables.pdf
test_026_leftright.rml test_026_leftright.pdf
test_026_leftright_story.rml test_026_leftright_story.pdf
test_026_leftright_story_1.rml test_026_leftright_story_1.pdf
test_027_hardtoc.rml test_027_hardtoc.pdf
test_028_fields.rml test_028_fields.pdf
test_029_keepinframe.rml test_029_keepinframe.pdf
test_030_codepages.rml test_030_codepages.pdf
test_031_japanese.rml test_031_japanese.pdf
test_032_alt_images.rml test_032_alt_images.pdf
test_032_default_images.rml test_032_default_images.pdf
test_032_images.rml test_032_images.pdf
test_032_missing_image_error.rml Has not been generated
test_033_useb4def.rml test_033_useb4def.pdf
test_034_cmyk.rml test_034_cmyk.pdf
test_035_numbering.rml test_035_numbering.pdf
test_036_numbering_contd.rml test_036_numbering_contd.pdf
test_037_plugingraphic.rml test_037_plugingraphic.pdf
test_038_rect_href.rml test_038_rect_href.pdf
test_039_doc_programming.rml test_039_doc_programming.pdf
test_040_colors.rml test_040_colors.pdf
test_041_masking.rml test_041_masking.pdf
test_042_longdoc.rml test_042_longdoc.pdf
test_043_headings.rml test_043_headings.pdf
test_044_codesnippets.rml test_044_codesnippets.pdf
test_045_alpha.rml test_045_alpha.pdf
test_045_cmyk.rml test_045_cmyk.pdf
test_045_cmyk_sep.rml test_045_cmyk_sep.pdf
test_045_overprint.rml test_045_overprint.pdf
test_045_sep_black.rml test_045_sep_black.pdf
test_045_sep_cmyk.rml test_045_sep_cmyk.pdf
test_045_separations.rml test_045_separations.pdf
test_046_lists.rml test_046_lists.pdf
test_047_paraStyle_condPageBreak.rml test_047_paraStyle_condPageBreak.pdf
test_048_paragraph_flow_controls.rml test_048_paragraph_flow_controls.pdf
test_049_pre.rml test_049_pre.pdf
test_050_paths.rml test_050_paths.pdf
test_051_balancedcolumns.rml test_051_balancedcolumns.pdf
test_052_pagenum.rml test_052_pagenum.pdf
test_053_known_entities.rml test_053_known_entities.pdf
test_053_known_entities_vera.rml test_053_known_entities_vera.pdf
test_054_blockTable_run_error.rml Has not been generated
test_054_docExec_run_error.rml Has not been generated
test_054_excelData_run_error.rml Has not been generated
test_054_image_p_run_error.rml Has not been generated
test_054_image_run_error.rml Has not been generated
test_054_nextPage_run_error.rml Has not been generated
test_054_setFont_run_error.rml Has not been generated
test_054_td_run_error.rml Has not been generated
test_055_accessibility.rml test_055_accessibility.pdf
test_056_pagebg.rml test_056_pagebg.pdf
test_057_taggedparas.rml(ReportLab PLUS>=4.0) test_057_taggedparas.pdf
test_057_taggedparas_p.rml test_057_taggedparas_p.pdf
test_058_taggedvarious.rml(ReportLab PLUS>=4.0) test_058_taggedvarious.pdf
test_059_rotations.rml test_059_rotations.pdf
test_060_markedcontentstory.rml(ReportLab PLUS>=4.0) test_060_markedcontentstory.pdf
test_061_long_textfield.rml test_061_long_textfield.pdf