RML (Report Markup Language) is ReportLab's own language for specifying the appearance of a printed page, which is converted into PDF by the utility rml2pdf.
These RML samples showcase techniques and features for generating various types of ouput and are distributed within our commercial package as test cases. Each should be self explanatory and stand alone.
Barcode support in RML This shows a few different barcodes and the techniques for using them. There are two tags which can be used and the source for this test file shows both. The first is a graphics tag which can be used in an <illustration> tag, and thus positioned at the precise location of your choice... <barcode x="1cm" y="1cm" code="Code128">AB-123456</barcode> The second technique is a 'flowable' tag which can be used within the story, and thus placed between two paragraphs with ease. <barCodeFlowable code="Standard39" value="PFWZF" barWidth="0.01in" quiet="no"/> Currently we support these attributes for the 'code' attribute in both tags: ( I2of5 | Code128 | Standard93 | Extended93 | Standard39 | Extended39 | MSI | Codabar | Code11 | FIM | POSTNET | USPS_4State | EAN8 | EAN13 | QR) There are many other attributes defined in the rml.dtd file, but in general barcodes know how to draw themselves at the correct size, and if you are using a specific code you will know which ones apply to you. Code11 01234545634563 Code128 AB-12345678 Code128 with some custom settings AB-12345678 A bar chart flowable tag should appear after this paragraph in "Standard39" code. It works out its height so if you need space before and after, use the "spacer" tag. More on the next page EAN13 - European Article Number with 13 digits These have a natural size of approx 3.8cm x 2.8cm, which is the one on the left. Since these are graphical tags, if you need it a bit bigger or smaller then the safest approach is to use the RML 'scale' tag to uniformly scale up or down the widget. You may also tweak the size by adjusting the barWidth, barHeight and spaceWidth properties but ensure you do test scans if using any 'unnatural' size; the two cases on the right have been tweaked in this way. 123456789012 2222222222222 3333333333333 Here's the 'flowable' version of the same code...it should look like the one on the left above And here's one in the shorter EAN8... QR 2d barcode contributed by Germán M. Bravo <german.mb@gmail.com> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]>