[Checkins] SVN: z3c.rml/trunk/src/z3c/rml/ Started quest to be almost fully RML compliant. This is of course far beyond

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 14 16:12:59 EDT 2007


Log message for revision 73175:
  Started quest to be almost fully RML compliant. This is of course far beyond 
  any documentation that I have ever seen, but luckily there are test files 
  that I can use to get a clue.
  
  

Changed:
  U   z3c.rml/trunk/src/z3c/rml/attr.py
  U   z3c.rml/trunk/src/z3c/rml/canvas.py
  U   z3c.rml/trunk/src/z3c/rml/document.py
  U   z3c.rml/trunk/src/z3c/rml/flowable.py
  U   z3c.rml/trunk/src/z3c/rml/special.py
  U   z3c.rml/trunk/src/z3c/rml/stylesheet.py
  U   z3c.rml/trunk/src/z3c/rml/template.py
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-000-simple.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-001-hello.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-002-paras.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-003-frames.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-fpt-templates.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-templates.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-005-fonts.rml
  A   z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-006-barcodes.rml

-=-
Modified: z3c.rml/trunk/src/z3c/rml/attr.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/attr.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/attr.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -23,9 +23,11 @@
 import reportlab.lib.styles
 import reportlab.lib.units
 import reportlab.lib.utils
+import reportlab.lib.pagesizes
 import reportlab.graphics.widgets.markers
 import urllib
 from lxml import etree
+from xml.sax import saxutils
 
 from z3c.rml import interfaces
 
@@ -51,7 +53,6 @@
             return default
         return self.convert(value, context)
 
-
 class Text(Attribute):
 
     def convert(self, value, context=None):
@@ -141,7 +142,8 @@
 
 
 class DefaultBool(Bool):
-    choices = Bool.choices.copy().update({'default': None})
+    choices = Bool.choices.copy()
+    choices.update({'default': None})
 
 
 class Measurement(Attribute):
@@ -158,8 +160,8 @@
             res = unit[0].search(value, 0)
             if res:
                 return unit[1]*float(res.group(1))
+        raise ValueError('The value %r is not a valid measurement.' %value)
 
-
 class Image(Text):
 
     open = urllib.urlopen
@@ -197,28 +199,30 @@
         super(Style, self).__init__(name, default)
         self.type = type
 
-    def convert(self, value, context=None, isDefault=False):
+    def convert(self, value, context=None):
         # First, get the custom styles
         proc = context
         while (not interfaces.IStylesManager.providedBy(proc) and
                proc is not None):
             proc = proc.parent
-        styles = proc.styles.get(self.type, {})
-        # Now look up default values
-        if isDefault:
-            if 'style.' + value in styles:
+        for styles in (proc.styles.get(self.type, {}),
+                       reportlab.lib.styles.getSampleStyleSheet().byName):
+            if value in styles:
+                return styles[value]
+            elif 'style.' + value in styles:
                 return styles['style.' + value]
-            return reportlab.lib.styles.getSampleStyleSheet()[value]
-        return styles[value]
+            elif value.startswith('style.') and value[6:] in styles:
+                return styles[value[6:]]
+        raise ValueError('Style %r could not be found.' %value)
 
     def get(self, element, default=DEFAULT, context=None):
         value = element.get(self.name, DEFAULT)
         if value is DEFAULT:
             if default is DEFAULT:
-                return self.convert(self.default, context, True)
+                return self.convert(self.default, context)
             elif default is None:
                 return None
-            return self.convert(default, context, True)
+            return self.convert(default, context)
         return self.convert(value, context)
 
 
@@ -227,7 +231,35 @@
     def convert(self, value, context=None):
         return reportlab.graphics.widgets.markers.makeMarker(value)
 
+class PageSize(Attribute):
 
+    sizePair = Sequence(valueType=Measurement())
+    words = Sequence(valueType=Attribute())
+
+    def convert(self, value, context=None):
+        # First try to get a pair
+        try:
+            return self.sizePair.convert(value, context)
+        except ValueError:
+            pass
+        # Now we try to lookup a name. The following type of combinations must
+        # work: "Letter" "LETTER" "A4 landscape" "letter portrait"
+        words = self.words.convert(value, context)
+        words = [word.lower() for word in words]
+        # First look for the orientation
+        orienter = None
+        for orientation in ('landscape', 'portrait'):
+            if orientation in words:
+                orienter = getattr(reportlab.lib.pagesizes, orientation)
+                words.remove(orientation)
+        # We must have exactely one value left that matches a paper size
+        pagesize = getattr(reportlab.lib.pagesizes, words[0].upper())
+        # Now do the final touches
+        if orienter:
+            pagesize = orienter(pagesize)
+        return pagesize
+
+
 class TextNode(Attribute):
     """Text ndoes are not really attributes, but behave mostly like it."""
 
@@ -237,7 +269,19 @@
     def get(self, element, default=DEFAULT, context=None):
         return unicode(element.text).strip()
 
+class FirstLevelTextNode(TextNode):
+    """Text ndoes are not really attributes, but behave mostly like it."""
 
+    def __init__(self):
+        super(TextNode, self).__init__('TEXT')
+
+    def get(self, element, default=DEFAULT, context=None):
+        text = element.text or u''
+        for child in element.getchildren():
+            text += child.tail or u''
+        return text
+
+
 class TextNodeSequence(Sequence):
 
     def __init__(self, *args, **kw):
@@ -280,7 +324,7 @@
                     subElement, context, None)
                 substitute.process()
         # Now create the text
-        text = element.text or u''
+        text = saxutils.escape(element.text or u'')
         for child in element.getchildren():
             text += etree.tounicode(child)
         if text is None:

Modified: z3c.rml/trunk/src/z3c/rml/canvas.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/canvas.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/canvas.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -168,6 +168,32 @@
                 raise ValueError("Not enough space")
 
 
+class Param(element.FunctionElement):
+    args = (attr.Attribute('name'), attr.TextNode() )
+
+    def process(self):
+        name, value = self.getPositionalArguments()
+        self.context[name] = value
+
+class TextAnnotation(element.ContainerElement, element.FunctionElement):
+    args = (attr.FirstLevelTextNode(), )
+
+    paramTypes = {
+        'escape': attr.Int(),
+        }
+
+    subElements = {'param': Param}
+
+    def process(self):
+        contents = self.getPositionalArguments()[0]
+        params = {}
+        self.processSubElements(params)
+        for name, type in self.paramTypes.items():
+            if name in params:
+                params[name] = type.convert(params[name])
+        self.context.textAnnotation(contents, **params)
+
+
 class MoveTo(element.FunctionElement):
     args = (
         attr.TextNodeSequence(attr.Measurement(), length=2),
@@ -317,6 +343,7 @@
         'curves': Curves,
         'image': Image,
         'place': Place,
+        'textAnnotation': TextAnnotation,
         'path': Path,
         # Form Field Elements
         'barCode': form.BarCode,

Modified: z3c.rml/trunk/src/z3c/rml/document.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/document.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/document.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -18,12 +18,58 @@
 __docformat__ = "reStructuredText"
 import sys
 
+from reportlab.pdfbase import pdfmetrics, ttfonts
 from z3c.rml import attr, element, error
 from z3c.rml import canvas, stylesheet, template
 
 
-class Document(element.Element):
+class RegisterType1Face(element.Element):
+    args = ( attr.Attribute('afmFile'), attr.Attribute('pfbFile') )
 
+    def process(self):
+        args = element.extractPositionalArguments(self.args, self.element)
+        face = pdfmetrics.EmbeddedType1Face(*args)
+        pdfmetrics.registerTypeFace(face)
+
+
+class RegisterFont(element.Element):
+    args = (
+        attr.Attribute('name'),
+        attr.Attribute('faceName'),
+        attr.Attribute('encName') )
+
+    def process(self):
+        args = element.extractPositionalArguments(self.args, self.element)
+        font = pdfmetrics.Font(*args)
+        pdfmetrics.registerFont(font)
+
+
+class RegisterTTFont(element.Element):
+    args = (
+        attr.Attribute('faceName'),
+        attr.Attribute('fileName') )
+
+    def process(self):
+        args = element.extractPositionalArguments(self.args, self.element)
+        font = ttfonts.TTFont(*args)
+        pdfmetrics.registerFont(font)
+
+
+class DocInit(element.ContainerElement):
+
+    subElements = {
+        'registerType1Face': RegisterType1Face,
+        'registerFont': RegisterFont,
+        'registerTTFont': RegisterTTFont,
+        }
+
+
+class Document(element.ContainerElement):
+
+    subElements = {
+        'docinit': DocInit
+        }
+
     def __init__(self, element):
         self.element = element
 
@@ -33,6 +79,8 @@
             # TODO: This is relative to the input file *not* the CWD!!!
             outputFile = open(self.element.get('filename'), 'w')
 
+        self.processSubElements(None)
+
         if self.element.find('pageDrawing') is not None:
             canvas.Canvas(self.element).process(outputFile)
 

Modified: z3c.rml/trunk/src/z3c/rml/flowable.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/flowable.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/flowable.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -85,6 +85,7 @@
 class Paragraph(Flowable):
     klass = platypus.Paragraph
     args = ( attr.XMLContent(u''), attr.Style('style', 'para', 'Normal') )
+    kw = ( ('bulletText', attr.Attribute('bulletText')), )
 
 class Title(Paragraph):
     args = ( attr.XMLContent(u''), attr.Style('style', 'para', 'Title'), )

Modified: z3c.rml/trunk/src/z3c/rml/special.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/special.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/special.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -16,7 +16,7 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
-from z3c.rml import attr, element
+from z3c.rml import attr, element, interfaces
 
 
 class Name(element.FunctionElement):
@@ -49,12 +49,15 @@
         parent.remove(self.element)
 
 
-class Alias(element.Element):
+class Alias(element.FunctionElement):
+    args = (
+        attr.Style('id'),
+        attr.Text('value'), )
 
     def process(self):
-        id = attr.Text('id').get(self.element)
-        value = attr.Text('value').get(self.element)
+        id, value = self.getPositionalArguments()
         elem = self
-        while not hasattr(elem, 'styles') and elem is not None:
+        while (not interfaces.IStylesManager.providedBy(elem) and
+               elem is not None):
             elem = elem.parent
-        elem.styles[value] = elem.styles[id]
+        elem.styles[value] = id

Modified: z3c.rml/trunk/src/z3c/rml/stylesheet.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/stylesheet.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/stylesheet.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -34,7 +34,7 @@
     attrs = (
         attr.Text('name'),
         attr.Text('alias'),
-        attr.Text('parent'),
+        attr.Style('parent'),
         attr.Text('fontName'),
         attr.Measurement('fontSize'),
         attr.Measurement('leading'),
@@ -48,25 +48,21 @@
              'right':reportlab.lib.enums.TA_RIGHT,
              'center':reportlab.lib.enums.TA_CENTER,
              'justify':reportlab.lib.enums.TA_JUSTIFY}),
-        attr.Text('bulletFontname'),
-        attr.Measurement('bulletFontsize'),
+        attr.Text('bulletFontName'),
+        attr.Measurement('bulletFontSize'),
         attr.Measurement('bulletIndent'),
         attr.Color('textColor'),
         attr.Color('backColor')
         )
 
-    def baseStyle(self, name=None):
-        name = name or 'Normal'
-        styles = reportlab.lib.styles.getSampleStyleSheet()
-        return copy.deepcopy(styles[name])
-
     def process(self):
         attrs = element.extractKeywordArguments(
-            [(attr.name, attr) for attr in self.attrs], self.element)
+            [(attr.name, attr) for attr in self.attrs], self.element,
+            self.parent)
 
-        style = self.baseStyle(attrs.get('parent'))
-        if 'parent' in attrs:
-            del attrs['parent']
+        parent = attrs.pop(
+            'parent', reportlab.lib.styles.getSampleStyleSheet()['Normal'])
+        style = copy.deepcopy(parent)
 
         for name, value in attrs.items():
             setattr(style, name, value)

Modified: z3c.rml/trunk/src/z3c/rml/template.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/template.py	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/template.py	2007-03-14 20:12:58 UTC (rev 73175)
@@ -23,8 +23,16 @@
 
 
 class Story(flowable.Flow):
-    pass
 
+    def getFirstPageTemplateIndex(self, doc):
+        fpt = attr.Text('firstPageTemplate').get(self.element, None)
+        if fpt is None:
+            return 0
+        for idx, pageTemplate in enumerate(doc.pageTemplates):
+            if pageTemplate.id == fpt:
+                return idx
+        raise ValueError('%r is not a correct page template id.' %fpt)
+
 class Frame(element.FunctionElement):
     args = (
         attr.Measurement('x1'), attr.Measurement('y1'),
@@ -33,10 +41,10 @@
     kw = (
         ('id', attr.Text('id')),
         # Non-RML compliant extensions
-        ('leftPadding', attr.Measurement('leftPadding')),
-        ('rightPadding', attr.Measurement('rightPadding')),
-        ('topPadding', attr.Measurement('topPadding')),
-        ('bottomPadding', attr.Measurement('bottomPadding')),
+        ('leftPadding', attr.Measurement('leftPadding', 0)),
+        ('rightPadding', attr.Measurement('rightPadding', 0)),
+        ('topPadding', attr.Measurement('topPadding', 0)),
+        ('bottomPadding', attr.Measurement('bottomPadding', 0)),
         ('showBoundary', attr.Bool('showBoundary')),
         )
 
@@ -62,7 +70,7 @@
 class PageTemplate(element.FunctionElement, element.ContainerElement):
     args = (attr.Text('id'),)
     kw = (
-        ('pagesize', attr.Sequence('pageSize', attr.Measurement(), length=2)),
+        ('pagesize', attr.PageSize('pageSize',)),
         ('rotation', attr.Int('rotation')) )
 
     subElements = {
@@ -72,7 +80,9 @@
 
     def process(self):
         args = self.getPositionalArguments()
-        pt = platypus.PageTemplate(*args)
+        # Pass in frames explicitely, since they have it as a keyword argument
+        # using an empty list; Sigh!
+        pt = platypus.PageTemplate(frames=[], *args)
 
         kw = self.getKeywordArguments()
         if 'pagesize' in kw:
@@ -86,7 +96,7 @@
     zope.interface.implements(interfaces.IStylesManager)
 
     templateArgs = (
-        ('pagesize', attr.Sequence('PageSize', attr.Measurement(), length=2)),
+        ('pagesize', attr.PageSize('pageSize',)),
         ('rotation', attr.Int('rotation')),
         ('leftMargin', attr.Measurement('leftMargin')),
         ('rightMargin', attr.Measurement('rightMargin')),
@@ -125,5 +135,8 @@
 
         self.processSubElements(doc)
 
-        story = Story(docElement.find('story'), self, doc).process()
-        doc.build(story)
+        story = Story(docElement.find('story'), self, doc)
+        flowables = story.process()
+
+        doc._firstPageTemplateIndex = story.getFirstPageTemplateIndex(doc)
+        doc.build(flowables)

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-000-simple.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-000-simple.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-000-simple.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,16 @@
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_000_simple.pdf" invariant="1">
+<stylesheet/>
+
+<pageDrawing>
+<drawCentredString x="4.1in" y="5.8in">
+Hello World. First Page Drawing
+</drawCentredString>
+</pageDrawing>
+<pageDrawing>
+<drawCentredString x="3.1in" y="4.8in">
+Hello World. Second Page Drawing
+</drawCentredString>
+</pageDrawing>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-001-hello.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-001-hello.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-001-hello.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,57 @@
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_001_hello.pdf" invariant="1">
+
+<template pageSize="letter" leftMargin="72" showBoundary="1">
+	<pageTemplate id="main" pageSize="letter portrait">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite</drawRightString>
+		<textAnnotation><param name="Rect">0,0,1,1</param><param name="F">3</param><param name="escape">6</param>X::PDF
+PX(S)
+MT(PINK)
+</textAnnotation>
+	</pageGraphics>
+	<frame id="first" x1="1in" y1="1in" width="6.27in" height="9.69in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+	<alias id="style.Normal" value="style.normal"/>
+	</initialize>
+	<paraStyle name="h1" fontName="Helvetica-BoldOblique" fontSize="32" leading="36"/>
+	<paraStyle name="normal" fontName="Helvetica" fontSize="10" leading="12"/>
+	<paraStyle name="spaced" fontName="Helvetica" fontSize="10" leading="12" 
+		spaceBefore="12" spaceAfter="12"/>
+</stylesheet>
+
+<story>
+	<para style="normal">Hello World.  This is a normal paragraph. Blah <font color="red">IPO</font> blah blah blah blah growth forecast blah
+blah blah forecast blah.Blah blah blah blah blah blah blah blah blah blah blah profit blah blah blah blah blah
+blah blah blah blah blah IPO.Blah blah blah blah blah blah blah reengineering blah growth blah blah blah
+proactive direction strategic blah blah blah forward-thinking blah.Blah blah doubletalk blah blah blah blah
+blah profit blah blah growth blah blah blah blah blah profit.Blah blah blah blah venture capital blah blah blah
+blah blah forward-thinking blah. Here are some common characters &amp;#x92; = &#x92; 
+	</para>
+	<para style="normal">This is another normal paragraph. Blah IPO blah blah blah blah growth forecast blah
+blah blah forecast blah.Blah blah blah blah blah blah blah blah blah blah blah profit blah blah blah blah blah
+blah blah blah blah blah IPO.Blah blah blah blah blah blah blah reengineering blah growth blah blah blah
+proactive direction strategic blah blah blah forward-thinking blah.Blah blah doubletalk blah blah blah blah
+blah profit blah blah growth blah blah blah blah blah profit.Blah blah blah blah venture capital blah blah blah
+blah blah forward-thinking blah.
+	</para>
+	<para style="normal">
+	I should NOT have a tiny leading space in front of me!
+	</para>
+	<para style="spaced">This is spaced.  There should be 12 points before and after.</para>
+	<para style="normal">Hello World.  This is a normal paragraph. Blah IPO blah blah blah blah growth forecast blah
+blah blah forecast blah.Blah blah blah blah blah blah blah blah blah blah blah profit blah blah blah blah blah
+blah blah blah blah blah IPO.Blah blah blah blah blah blah blah reengineering blah growth blah blah blah
+proactive direction strategic blah blah blah forward-thinking blah.Blah blah doubletalk blah blah blah blah
+blah profit blah blah growth blah blah blah blah blah profit.Blah blah blah blah venture capital blah blah blah
+blah blah forward-thinking blah.
+	</para>
+	
+</story>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-002-paras.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-002-paras.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-002-paras.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_002_paras.pdf"> 
+
+
+<template pageSize="(595, 842)" leftMargin="72" showBoundary="1">
+	<pageTemplate id="main">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #2</drawRightString>
+	</pageGraphics>
+	<frame id="first" x1="1in" y1="1in" width="6.27in" height="9.69in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+	<alias id="style.Normal" value="style.normal"/>
+	</initialize>
+
+	<paraStyle name="h1"
+	fontName="Courier-Bold"
+	fontSize="12"
+	spaceBefore = "0.5 cm"
+	/>
+	
+	<paraStyle name="style1"
+	fontName="Courier"
+	fontSize="10"
+	/>
+
+	<paraStyle name="style2"
+	parent="style1"
+	leftIndent = "1in"
+	/>
+
+	<paraStyle name="style3"
+	parent="style1"
+	rightIndent = "1in"
+	/>
+
+	<paraStyle name="style4"
+	parent="style1"
+	spaceBefore = "2cm"
+	/>
+
+	<paraStyle name="style5"
+	parent="style1"
+	spaceAfter = "2cm"
+	/>
+
+	<paraStyle name="style6"
+	parent="style1"
+	firstLineIndent = "2cm"
+	/>
+
+	<paraStyle name="style7"
+	parent="style1"
+	leading = "15"
+	/>
+	<!-- NB Leading isn't just the space between lines - it is
+	expressed as the height of the line PLUS the space between
+	lines. This leading of 15 is equal to a space of 5 pts between
+	lines.-->
+
+	<paraStyle name="style8"
+	parent="style1"
+	bulletFontName = "ZapfDingbats"
+	bulletFontSize = "5"
+	/>
+
+	<paraStyle name="style9"
+	parent="style8"
+	bulletFontSize = "10"
+	bulletIndent = "20"
+	/>
+
+	<paraStyle name="style10"
+	parent="style9"
+	bulletIndent = "20"
+	leftIndent = "35"
+	/>
+
+	<paraStyle name="style11"
+	parent="style1"
+	alignment = "left"
+	/>
+
+	<paraStyle name="style12"
+	parent="style1"
+	alignment = "right"
+	/>
+
+	<paraStyle name="style13"
+	parent="style1"
+	alignment = "center"
+	/>
+
+	<paraStyle name="style14"
+	parent="style1"
+	alignment = "justify"
+	/>
+
+	<paraStyle name="style15"
+	parent="style10"
+	bulletFontSize = "5"
+	alignment = "left"
+	/>
+
+	<paraStyle name="style16"
+	parent="style10"
+	bulletFontSize = "5"
+	alignment = "right"
+	/>
+
+	<paraStyle name="style17"
+	parent="style10"
+	bulletFontSize = "5"
+	alignment = "center"
+	/>
+
+	<paraStyle name="style18"
+	parent="style10"
+	bulletFontSize = "5"
+	alignment = "justify"
+	/>
+
+	<paraStyle name="style20"
+	parent="style1"
+	textColor = "red"
+	spaceBefore="1cm"
+	spaceAfter="2cm"
+	/>
+	
+	<paraStyle name="style21"
+	parent="style1"
+	textColor = "green"
+	spaceBefore="1cm"
+	spaceAfter="2cm"
+	/>
+
+	<paraStyle name="style22"
+	parent="style1"
+	textColor = "blue"
+	spaceBefore="1cm"
+	spaceAfter="2cm"
+	/>
+
+
+    <!-- Colours by Hex value -->
+    <!-- NB THIS CURRENTLY DOESN'T WORK! -->
+    <!--
+    <paraStyle name="style23"
+	parent="style1"
+	textColor = "#FF0000"
+	/>
+	
+	<paraStyle name="style24"
+	parent="style1"
+	textColor = "#00FF00"
+	/>
+
+	<paraStyle name="style25"
+	parent="style1"
+	textColor = "#0000FF"
+	/>
+	-->
+
+
+    <!-- Colours by RGB value -->
+    <!-- NB THIS CURRENTLY DOESN'T WORK! -->
+    <!--
+    <paraStyle name="style26"
+	parent="style1"
+	textColor = "1,0,0"
+	/>
+	
+	<paraStyle name="style27"
+	parent="style1"
+	textColor = "0,1,0"
+	/>
+
+	<paraStyle name="style28"
+	parent="style1"
+	textColor = "0,0,1"
+	/>
+	-->
+
+	<paraStyle name="bugReport"
+	parent="h1"
+	spaceBefore = "0"
+	textColor = "red"
+	/>
+		
+</stylesheet>
+
+
+<story>
+<nextPage suppressFirst="1"/>
+
+
+<para style="style1">
+    This checks for all the possible quotes: &amp;amp; = &amp;, 
+    &amp;lt; = &lt;, &amp;gt; = &gt;, &amp;apos; = &apos;, &amp;quot; = &quot;, 
+    &amp;pound; = &pound;.
+</para>
+
+
+<para style="h1">Paragraph 1: About this page</para>
+<para style="style1">This page tests out a number of attributes of the <b>paraStyle</b> tag.
+This paragraph is in a style we have called "style1". It should be a normal paragraph, set in Courier 12 pt.
+It should be a normal paragraph, set in Courier (not bold).
+It should be a normal paragraph, set in Courier 12 pt.</para>
+
+<para style="h1">Paragraph 2: Indent Left</para>
+<para style="style2">This paragraph is in a style we have called "style2". It should be indented on the left. 
+It should be indented on the left by 1 inch. 
+It should be indented on the left. </para>
+
+<para style="h1">Paragraph 3: Indent Right</para>
+<para style="style3">This paragraph is in a style we have called "style3". It should be indented on the right. It should be indented on the right by 1 inch. It should be indented on the right. </para>
+
+<para style="h1">Paragraph 4: Space Before</para>
+<para style="style4">This paragraph is in a style we have called "style4". It should be have a space before it.  It should be have a space before it of 2 centimeters. It should be have a space before it.</para>
+
+<para style="h1">Paragraph 5: Space After</para>
+<para style="style5">This paragraph is in a style we have called "style5". It should be have a space after it.  It should be have a space after it of 2 centimeters. It should be have a space after it.</para>
+
+<para style="h1">Paragraph 6: First Line Indent</para>
+<para style="style6">This paragraph is in a style we have called "style6".It should be have an indented first line.  It should be have an first line indented by 2 centimeters. It should be have an indented first line.</para>
+<para style="h1">Paragraph 7: Leading</para>
+<para style="style7">This paragraph is in a style we have called "style7". It should be using leading. It should have a gap of 5 points between each line. It should be using leading. It should have a gap of 5 pt between each line. It should be using leading. The gap between lines should be half of the height of a line. This paragraph should look like it has a line spacing of "1.5 lines" </para>
+
+<para style="h1">Paragraphs 8-12: Simple Bullet Points</para>
+<para style="style8" bulletText="l"><b>Parastyle name="style8" parent="style1" bulletFontName = "ZapfDingbats" bulletFontSize = "5"</b></para>
+<para style="style8" bulletText="l">These paragraphs are in a style we have called "style8"</para>
+<para style="style8" bulletText="l">These five lines should have bullet points.</para>
+<para style="style8" bulletText="l">The bullet font is ZapfDingbats.</para>
+<para style="style8" bulletText="l">The bullet size is 5 points</para>
+<para style="style8" bulletText="l">This is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style8". These four lines should have bullet points. The bullet font is ZapfDingbats. The bullet size is 5 points</para>
+
+<para style="h1">Paragraph 13-18: Indented Bullet Points</para>
+<para style="style9" bulletText="*"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "10" bulletIndent = "20"</b></para>
+<para style="style9" bulletText="*">These paragraphs are in a style we have called "style9"</para>
+<para style="style9" bulletText="*">These five lines should have <i>indented</i> bullet points.</para>
+<para style="style9" bulletText="*">Bullet points should look like a pointing hand.</para>
+<para style="style9" bulletText="*">Bullet font is still ZapfDingbats, and bullet size is 10 points.</para>
+<para style="style9" bulletText="*">The bullet indent is 20 points</para>
+<para style="style9" bulletText="*">This is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style9". These four lines should have <i>indented</i> bullet points. Bullet points should look like a pointing hand. Bullet font is still ZapfDingbats, and bullet size is 10 points. The bullet indent is 20 points</para>
+
+<para style="h1">Paragraph 19-24: Indented Bullet Points with a Left Indent for the Text</para>
+<para style="style10" bulletText="*"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "10" bulletIndent = "20" leftIndent = "35"</b></para>
+<para style="style10" bulletText="*">These paragraphs are in a style we have called "style10"</para>
+<para style="style10" bulletText="*">These four lines should have <i>indented</i> bullet points, with the text indented as well.</para>
+<para style="style10" bulletText="*">Bullet points should look like a pointing hand.</para>
+<para style="style10" bulletText="*">Bullet font is still ZapfDingbats, and bullet size is 10 points.</para>
+<para style="style10" bulletText="*">The bullet indent is 20 points, and the text indent is 35 points</para>
+<para style="style10" bulletText="*">This is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style10". These four lines should have <i>indented</i> bullet points, with the text indented as well. Bullet points should look like a pointing hand. Bullet font is still ZapfDingbats, and bullet size is 10 points.</para>
+
+<para style="h1">Paragraph 25: Left Justified Paragraphs</para>
+<para style="style11">This paragraph is in a style we have called "style11". It should be left justified. It has an argument which states 'alignment = "left"'. It should be left justified.  It should be aligned to the left. </para>
+
+<para style="h1">Paragraph 26: Right Justified Paragraphs</para>
+<para style="style12">This paragraph is in a style we have called "style12". It should be right justified. It has an argument which states 'alignment = "right"'. It should be right justified.  It should be aligned to the right.</para>
+
+<para style="h1">Paragraph 27: Centered Paragraphs</para>
+<para style="style13">This paragraph is in a style we have called "style13".It should be center justified. It has an argument which states 'alignment = "center"'. It should be centered.  It should be aligned to the center.</para>
+
+<para style="h1">Paragraph 28: Justified Paragraphs</para>
+<para style="style14">This paragraph is in a style we have called "style14". It should be justified. It has an argument which states 'alignment = "justify"'. It should be justified. This paragraph doesn't contain any bold text though.</para>
+<para style="h1">Paragraph 28.1: Justified Paragraphs With Bold Text</para>
+<para style="style14">This paragraph is in a style we have called "style14". It should be <b>justified</b>. It has an argument which states <b>'alignment = "justify"'</b>. It should be justified. This paragraph doesn't contain any bold text though.</para>
+
+<para style="h1">Paragraphs 29-32: Bullets using left align, right align, centered and justify.</para>
+<para style="style15" bulletText="l"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" 	alignment = "left"</b></para>
+<para style="style15" bulletText="l">This is "style15", bullets with a left alignment. (The bullets in this style are based on "style10")</para>
+<para style="style16" bulletText="l"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" 	alignment = "right"</b></para>
+<para style="style16" bulletText="l">This is "style16", bullets with a right alignment.(The bullets in this style are based on "style10")</para>
+<para style="style17" bulletText="l"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" 	alignment = "center"</b></para>
+<para style="style17" bulletText="l">This is "style17", bullets with a center alignment.(The bullets in this style are based on "style10")</para>
+<para style="style18" bulletText="l"><b>bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" 	alignment = "justify"</b></para>
+<para style="style18" bulletText="l">This is "style18", bullets with a justified paragraph.(The bullets in this style are based on "style10")</para>
+<para style="style1">These all look wierd, but most people do not actually use these styles because they look so wrong.</para>
+
+<para style="h1">Paragraph 33-35: Using Colours by Colour Name</para>
+<para style="style20">This text should be <b>RED</b></para>
+<para style="style21">This text should be <b>GREEN</b></para>
+<para style="style22">This text should be <b>BLUE</b></para>
+
+<!-- THESE CURRENTLY DON'T WORK - SEE THE STYLES SECTION -->
+<!--
+<para style="h1">Paragraph 36-38: Using Colours by Hex Value</para>
+<para style="style23">This text should be <b>RED</b></para>
+<para style="style24">This text should be <b>GREEN</b></para>
+<para style="style25">This text should be <b>BLUE</b></para>
+
+<para style="h1">Paragraph 39-41: Using Colours by RGB Value</para>
+<para style="style26">This text should be <b>RED</b></para>
+<para style="style27">This text should be <b>GREEN</b></para>
+<para style="style28">This text should be <b>BLUE</b></para>
+-->
+
+<para style="bugReport">You <b>SHOULD</b> be able to specify colours
+by all the means available to reportlab.lib.colours. Currently, you
+<b>cannot</b> use RGB or HEX values...</para>
+
+<para style="h1">Last Paragraph: Para Tags and Paragraph Content</para>
+<para style="style1">
+    This should <i>not</i> have any extra spaces at the start of <b>this</b>
+    line (though there should be at the start of the heading). RML should ignore
+    additional whitespace, and you should be able to format the actual paragraphs
+    as you like. <u>This should be underlined</u>.   There should be line break after the colon:<br/>The text in this paragraph starts on a different line to the
+    actual "para" tag.
+</para>
+
+
+<para style="h1">Quoting and escaping</para>
+<para style="style1">
+    This checks for all the possible quotes: &amp;amp; = &amp;, 
+    &amp;lt; = &lt;, &amp;gt; = &gt;, &amp;apos; = &apos;, &amp;quot; = &quot;, 
+    &amp;pound; = &pound;.
+</para>
+<para style="style1">
+<i>If this is not italic</i>, <b>and this is not bold</b>, even normal angle brackets are broken.
+</para>
+<nextPage/>
+<imageAndFlowables imageName="images/replogo.gif" imageWidth="141" imageHeight="90">
+<para style="h1">Test imageAndFlowables tag with paras</para>
+<para style="style1">We should have an image on the <b>right</b> side of the paragraphs here. The imageAndFlowables
+tag can take an arbitrarary number of flowables and try to flow them round an image sepcified by attributes
+<i>imageName</i>
+<i>imageWidth</i>
+<i>imageHeight</i>
+<i>imageMask</i>; other attributes allow for padding and which side the image goes eg
+<i>imageTopPadding</i>
+<i>imageBottomPadding</i>
+<i>imageLeftPadding</i>
+<i>imageRightPadding</i>
+<i>imageSide</i>. Of course we hope that a single paragraph will flow properly round the image and that the <b>leading</b> should not appear to change during the process.
+On our assumptions, this selectionally introduced contextual feature is
+unspecified with respect to irrelevant intervening contexts in
+selectional rules.  To characterize a linguistic level L, a
+descriptively adequate grammar appears to correlate rather closely with
+a descriptive fact.  A consequence of the approach just outlined is that
+a case of semigrammaticalness of a different sort suffices to account
+for the system of base rules exclusive of the lexicon.  A majority  of
+informed linguistic specialists agree that the speaker-hearer's
+linguistic intuition raises serious doubts about the traditional
+practice of grammarians.  For one thing, the descriptive power of the
+base component does not readily tolerate problems of phonemic and
+morphological analysis.
+</para>
+</imageAndFlowables>
+<imageAndFlowables imageName="images/replogo.gif" imageWidth="141" imageHeight="90" imageSide="left">
+<para style="h1">Test imageAndFlowables tag with paras</para>
+<para style="style1">We should have an image on the <b>right</b> side of the paragraphs here.
+</para>
+<para style="style1">
+Summarizing, then, we assume that the fundamental error of regarding
+functional notions as categorial may remedy and, at the same time,
+eliminate the levels of acceptability from fairly high (e.g. (99a)) to
+virtual gibberish (e.g. (98d)).  This suggests that the theory of
+syntactic features developed earlier delimits a descriptive fact.  We
+have already seen that any associated supporting element is not quite
+equivalent to the traditional practice of grammarians.  From C1, it
+follows that the theory of syntactic features developed earlier can be
+defined in such a way as to impose irrelevant intervening contexts in
+selectional rules.  So far, a descriptively adequate grammar is rather
+different from a general convention regarding the forms of the grammar.
+</para>
+</imageAndFlowables>
+
+
+<para style="h1">Intra-paragraph &lt;br/&gt;</para>
+<para style="style1">
+And now for a break...<br/>
+here we should be one line two. <br/>
+Summarizing, then, we assume that the fundamental error of regarding
+functional notions as categorial may remedy and, at the same time,
+eliminate the levels of acceptability from fairly high (e.g. (99a)) to
+virtual gibberish (e.g. (98d)).  Now let's fake a bullet list:
+<br/>- bullet 1
+<br/>- bullet 2
+<br/>- bullet 3
+<br/>- bullet 4
+<br/>- bullet 15
+
+</para>
+
+
+</story>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-003-frames.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-003-frames.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-003-frames.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,111 @@
+<document filename="test_003_frames.pdf"> 
+
+
+<template pageSize="(595, 842)" leftMargin="72" showBoundary="1">
+	<pageTemplate id="main">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #3</drawRightString>
+	</pageGraphics>
+	<frame id="first" x1="1in" y1="5.845in" width="3in" height="4.645in"/>
+	<frame id="second" x1="4.27in" y1="5.845in" width="3in" height="4.645in"/>
+	<frame id="third" x1="1in" y1="1in" width="3in" height="4.645in"/>
+	<frame id="fourth" x1="4.27in" y1="1in" width="3in" height="4.645in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+	<alias id="style.normal" value="style.Normal"/>
+	</initialize>
+
+	<paraStyle
+	name="h1"
+	fontName="Helvetica-BoldOblique"
+	fontSize="20"
+	leading="36"
+	/>
+	
+	<paraStyle
+	name="normal"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	/>
+
+	<paraStyle
+	name="space below"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	spaceAfter="10"
+	/>
+
+	<paraStyle name="bugReport"
+	parent="h1"
+	spaceBefore = "0"
+	textColor = "red"
+	/>
+		
+</stylesheet>
+
+
+<story>
+<para style="h1">This is frame 1</para>
+<para style="space below"><b>This page tests to see that multiple frames display on one page. It also checks to see that the "nextFrame" tag works correctly to split the text in the story correctly between those frames.</b></para>
+<para style="normal">This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+</para>
+<nextFrame/>
+
+<para style="h1">This is frame 2</para>
+<para style="space below"><b>This page tests to see that multiple frames display on one page. It also checks to see that the "nextFrame" tag works correctly to split the text in the story correctly between those frames.</b></para>
+<para style="normal">This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+</para>
+<nextFrame/>
+
+<para style="h1">This is frame 3</para>
+<para style="space below"><b>This page tests to see that multiple frames display on one page. It also checks to see that the "nextFrame" tag works correctly to split the text in the story correctly between those frames.</b></para>
+<para style="normal">This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+</para>
+<nextFrame/>
+
+<para style="h1">This is frame 4</para>
+<para style="space below"><b>This page tests to see that multiple frames display on one page. It also checks to see that the "nextFrame" tag works correctly to split the text in the story correctly between those frames.</b></para>
+<para style="normal">This is the text for frame 4. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four. This is the text for frame four. This is the text for frame four. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four. This is the text for frame four. This is the text for frame four. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four.
+This is the text for frame 4. This is the text for frame four. This is the text for frame four.
+</para>
+
+</story>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-fpt-templates.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-fpt-templates.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-fpt-templates.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_004_fpt_templates.pdf"> 
+
+
+<template pageSize="(595, 842)" leftMargin="72" showBoundary="1" >
+	<pageTemplate id="secondary">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #4</drawRightString>
+		<setFont name="Helvetica-BoldOblique" size="36"/>
+		<drawCentredString x="297.5" y="755">Test #4: PAGE TWO</drawCentredString>
+		<setFont name="Helvetica-Bold" size="144"/>
+		<fill color="deepskyblue"/>
+		<drawCentredString x="297.5" y="539">2</drawCentredString>
+	</pageGraphics>
+	<frame id="p2-first" x1="1in" y1="1in" width="3in" height="4.645in"/>
+	<frame id="p2-second" x1="4.27in" y1="1in" width="3in" height="4.645in"/>
+	</pageTemplate>
+	<pageTemplate id="main">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #4</drawRightString>
+		<setFont name="Helvetica-BoldOblique" size="36"/>
+		<drawCentredString x="297.5" y="755">Test #4: PAGE ONE</drawCentredString>
+		<setFont name="Helvetica-Bold" size="144"/>
+		<fill color="teal"/>
+		<drawCentredString x="297.5" y="539">1</drawCentredString>
+	</pageGraphics>
+	<frame id="first" x1="1in" y1="1in" width="6.27in" height="4.645in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+	<alias id="style.normal" value="style.Normal"/>
+	</initialize>
+
+	<paraStyle
+	name="h1"
+	fontName="Helvetica-BoldOblique"
+	fontSize="20"
+	leading="36"
+	/>
+
+	<paraStyle
+	name="normal"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	/>
+
+	<paraStyle
+	name="space below"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	spaceAfter="10"
+	/>
+
+	<paraStyle name="bugReport"
+	parent="h1"
+	spaceBefore = "0"
+	textColor = "red"
+	/>
+		
+</stylesheet>
+
+
+<story firstPageTemplate="main">
+<para style="h1">This is page 1 - frame 1</para>
+<para style="space below"><b>This test spans two pages (this should be on page 1). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have a single frame at the bottom of the page displaying this text, a big teal-coloured number "1" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+</para>
+<setNextTemplate name="secondary"/>
+<nextFrame/>
+
+
+<para style="h1">This is page2 - frame1</para>
+<para style="space below"><b>This test spans two pages (this should be on page 2). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have two different frames at the bottom of the page displaying text, a big deepskyblue-coloured number "2" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+</para>
+<nextFrame/>
+
+<para style="h1">This is page2 - frame2</para>
+<para style="space below"><b>This test spans two pages (this should be on page 2). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have two different frames at the bottom of the page displaying text, a big deepskyblue-coloured number "2" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+</para>
+
+</story>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-templates.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-templates.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-004-templates.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_004_templates.pdf"> 
+
+
+<template pageSize="(595, 842)" leftMargin="72" showBoundary="1">
+	<pageTemplate id="main">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #4</drawRightString>
+		<setFont name="Helvetica-BoldOblique" size="36"/>
+		<drawCentredString x="297.5" y="755">Test #4: PAGE ONE</drawCentredString>
+		<setFont name="Helvetica-Bold" size="144"/>
+		<fill color="teal"/>
+		<drawCentredString x="297.5" y="539">1</drawCentredString>
+	</pageGraphics>
+	<frame id="first" x1="1in" y1="1in" width="6.27in" height="4.645in"/>
+	</pageTemplate>
+	<pageTemplate id="secondary">
+	<pageGraphics>
+		<setFont name="Helvetica-BoldOblique" size="18"/>
+		<drawRightString x="523" y="800">RML2PDF Test Suite - Test #4</drawRightString>
+		<setFont name="Helvetica-BoldOblique" size="36"/>
+		<drawCentredString x="297.5" y="755">Test #4: PAGE TWO</drawCentredString>
+		<setFont name="Helvetica-Bold" size="144"/>
+		<fill color="deepskyblue"/>
+		<drawCentredString x="297.5" y="539">2</drawCentredString>
+	</pageGraphics>
+	<frame id="p2-first" x1="1in" y1="1in" width="3in" height="4.645in"/>
+	<frame id="p2-second" x1="4.27in" y1="1in" width="3in" height="4.645in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+	<alias id="style.normal" value="style.Normal"/>
+	</initialize>
+
+	<paraStyle
+	name="h1"
+	fontName="Helvetica-BoldOblique"
+	fontSize="20"
+	leading="36"
+	/>
+
+	<paraStyle
+	name="normal"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	/>
+
+	<paraStyle
+	name="space below"
+	fontName="Helvetica"
+	fontSize="10"
+	leading="12"
+	spaceAfter="10"
+	/>
+
+	<paraStyle name="bugReport"
+	parent="h1"
+	spaceBefore = "0"
+	textColor = "red"
+	/>
+		
+</stylesheet>
+
+
+<story>
+<para style="h1">This is page 1 - frame 1</para>
+<para style="space below"><b>This test spans two pages (this should be on page 1). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have a single frame at the bottom of the page displaying this text, a big teal-coloured number "1" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one. This is the text for frame one. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one.
+This is the text for frame 1. This is the text for frame one. This is the text for frame one.
+</para>
+<setNextTemplate name="secondary"/>
+<nextFrame/>
+
+
+
+<para style="h1">This is page2 - frame1</para>
+<para style="space below"><b>This test spans two pages (this should be on page 2). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have two different frames at the bottom of the page displaying text, a big deepskyblue-coloured number "2" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two. This is the text for frame two. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two.
+This is the text for frame 2. This is the text for frame two. This is the text for frame two.
+</para>
+<nextFrame/>
+
+<para style="h1">This is page2 - frame2</para>
+<para style="space below"><b>This test spans two pages (this should be on page 2). It checks to see that using two separate templates works OK. It also tests to see that the "setNextTemplate" tag correctly splits the pages and displays them with the correct template.</b></para>
+<para style="space below"><b>Description of page:</b> This page should have two different frames at the bottom of the page displaying text, a big deepskyblue-coloured number "2" above it, and some header information above that.</para>
+<para style="normal">This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three. This is the text for frame three. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three.
+This is the text for frame 3. This is the text for frame three. This is the text for frame three.
+</para>
+
+
+</story>
+
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-005-fonts.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-005-fonts.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-005-fonts.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
+<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by Andy Robinson (ReportLab Inc.) -->
+<!DOCTYPE document SYSTEM "rml_1_0.dtd">
+<document filename="test_005_fonts.pdf">
+	<docinit>
+		<registerType1Face afmFile="LeERC___.AFM" pfbFile="LeERC___.PFB"/>
+		<registerFont name="LettErrorRobot-Chrome" faceName="LettErrorRobot-Chrome" encName="WinAnsiEncoding"/>
+		<registerTTFont faceName="rina" fileName="rina.ttf"/>
+	</docinit>
+	<template>
+		<pageTemplate id="main">
+			<frame id="first" x1="72" y1="72" width="451" height="698"/>
+		</pageTemplate>
+	</template>
+	<stylesheet>
+		<paraStyle name="robot" fontName="LettErrorRobot-Chrome" fontSize="12" spaceBefore="0.5 cm"/>
+		<paraStyle name="rina" fontName="rina" fontSize="12" spaceBefore="0.5 cm"/>
+	</stylesheet>
+	<story>
+		<para>
+		This paragraph is an ordinary font style, but switches font. 
+		<font face="LettErrorRobot-Chrome">This is in a custom font</font>
+		and <font face="rina">this is in a custom TTF font</font>.
+			<!-- doesn't work <font face="LettErrorRobot-Chrome"> -->
+<!--        Yahoo! Rooms 
+  Asian Markets - Discuss the latest market activity. 
+  Biotechnology - Discuss the latest research and advances in this field. 
+  Bond Market - Come here to chat live about the bond market! 
+  Career Corner - Find career tips and advice at http://careers.yahoo.com/ 
+  Small Business - Where professionals meet. Visit http://smallbusiness.yahoo.com/ 
+  StockWatch - Discuss the latest on Wall St. Visit http://finance.yahoo.com/  -->
+<!-- </font> -->
+		</para>
+		<para style="robot">This is a whole paragraph in the 'robot' style.</para>
+		<para style="rina">This is a whole paragraph in the 'rina' style.</para>
+		<illustration height="100" width="1">
+			<setFont name="LettErrorRobot-Chrome" size="25"/>
+			<drawString x="25" y="25">"LettErrorRobot-Chrome"</drawString>
+			<setFont name="rina" size="25"/>
+			<drawString x="25" y="50">"rina"</drawString>
+			<setFont name="Helvetica" size="16"/>
+			<drawString x="25" y="75">This is drawn directly in an illustration</drawString>
+		</illustration>
+    <para>
+	
+        <font face="Helvetica" size="9">This is Helvetica (plain).</font>
+        <font face="Helvetica" size="9"><i>This is Helvetica + italics.</i></font>
+		<font face="Helvetica-Oblique" size="9">This is Helvetica-Oblique.</font>
+		<font face="Helvetica-Oblique" size="9"><b>This is Helvetica-Oblique + BOLD.</b></font>
+    </para>
+
+    <para>
+        <i>This is plain text (no font face given) + italic.</i>
+    </para>
+
+		
+	</story>
+</document>

Added: z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-006-barcodes.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-006-barcodes.rml	2007-03-14 19:17:23 UTC (rev 73174)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/rml-examples-006-barcodes.rml	2007-03-14 20:12:58 UTC (rev 73175)
@@ -0,0 +1,55 @@
+<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
+<document filename="test_006_barcodes.pdf">
+
+<template pageSize="(595, 842)" leftMargin="72" showBoundary="1">
+	<pageTemplate id="main">
+	<frame id="first" x1="1in" y1="1in" width="6.27in" height="9.69in"/>
+	</pageTemplate>
+</template>
+
+<stylesheet>
+	<initialize>
+		<alias id="style.normal" value="style.Normal"/>
+	</initialize>
+	<paraStyle name="normal" fontName="Helvetica" fontSize="10" leading="12" spaceAfter="10"/>
+	<blockTableStyle id="temp001">
+		<blockAlignment value="left"/>
+		<blockFont name="Helvetica-Oblique"/>
+		<lineStyle kind="GRID" colorName="black"/>
+		<lineStyle kind="OUTLINE" colorName="black" thickness="2"/>
+	</blockTableStyle>
+</stylesheet>
+
+<story>
+	<para style="normal">
+		Various Barcodes as drawing ops. Original code contributed by Ty Sarnas.
+	</para>
+
+	<para style="normal">
+		Code11
+	</para>
+
+	<illustration width="10cm" height="1cm">
+		<barCode x="1cm" y="0" code="Code11">01234545634563</barCode>
+	</illustration>
+	
+<!--	<spacer length="1cm"/>
+	<para style="normal">Code128</para>
+	<illustration width="10cm" height="1cm">
+		<barCode x="1cm" y="0" code="Code128">AB-12345678</barCode>
+	</illustration>
+
+	<spacer length="1cm"/>
+	<para style="normal">Code128 With settings</para>
+	<illustration width="10cm" height="1cm">
+		<barCode x="1cm" y="0" code="Code128" barHeight="0.5in" barWidth="0.009in">AB-12345678</barCode>
+	</illustration>
+-->	<blockTable style="temp001">
+		<tr><td>barChartFlowable</td>
+			<td><barCodeFlowable code="Standard39" value="PFWZF" barWidth="0.01in" quiet="no"/></td>
+		</tr>
+	</blockTable>
+
+</story>
+
+</document>



More information about the Checkins mailing list