Add <pto> tag support to the RML parser
The ReportLab <pto> tag gives the developer a lot of flexibility. It lets you add a trailer on the frame when its contents must be split (i.e.: "please, turn over" or "continues on the next page"), and a header on the next frame ("continued from the previous page"). When used in combination with "<nextFrame/>" it enables the developer to do complex framed page layouts. The RML parser should implement this tag :(
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Sprints
Whiteboard
Example patch adding the required feature:
=== modified file 'bin/report/
--- bin/report/
+++ bin/report/
@@ -552,6 +552,29 @@
return Illustration(node, self.localcontext, self.styles, self)
+
+ def _pto(self, node):
+ sub_story = []
+ pto_header = None
+ pto_trailer = None
+ for node in utils._
+ if node.tag == etree.Comment:
+ node.text = ''
+ continue
+ elif node.tag=
+ pto_header = self.render(node)
+ elif node.tag=
+ pto_trailer = self.render(node)
+ else:
+ flow = self._flowable(
+ if flow:
+ if isinstance(
+ sub_story = sub_story + flow
+ else:
+ sub_story.
+ return platypus.
+
+
def _textual_
return base64.
@@ -679,6 +702,8 @@
return platypus.
+ elif node.tag=='pto':
+ return self._pto(node)
else:
return None