doctemplate.py: support for canvasmaker and rotation
authorrgbecker
Tue, 03 May 2005 11:40:11 +0000
changeset 2488 8bc9673fffa6
parent 2487 a51bf871b709
child 2489 f0560094aae9
doctemplate.py: support for canvasmaker and rotation
reportlab/platypus/doctemplate.py
--- a/reportlab/platypus/doctemplate.py	Tue May 03 11:39:22 2005 +0000
+++ b/reportlab/platypus/doctemplate.py	Tue May 03 11:40:11 2005 +0000
@@ -411,6 +411,7 @@
             self.pageTemplate.afterDrawPage(self.canv, self)
             self.pageTemplate.onPageEnd(self.canv, self)
             self.afterPage()
+            self.canv.setPageRotation(getattr(self.pageTemplate,'rotation',0)
             self.canv.showPage()
 
             if hasattr(self,'_nextPageTemplateCycle'):
@@ -826,7 +827,7 @@
         self._handle_pageBegin()
         self._handle_nextPageTemplate('Later')
 
-    def build(self,flowables,onFirstPage=_doNothing, onLaterPages=_doNothing):
+    def build(self,flowables,onFirstPage=_doNothing, onLaterPages=_doNothing, canvasmaker=canvas.Canvas):
         """build the document using the flowables.  Annotate the first page using the onFirstPage
                function and later pages using the onLaterPages function.  The onXXX pages should follow
                the signature
@@ -847,7 +848,7 @@
             self.pageTemplates[0].beforeDrawPage = self.onFirstPage
         if onLaterPages is _doNothing and hasattr(self,'onLaterPages'):
             self.pageTemplates[1].beforeDrawPage = self.onLaterPages
-        BaseDocTemplate.build(self,flowables)
+        BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
 
 
 def progressCB(typ, value):