[reportlab-users] pythonpoint patch

Karl Putland reportlab-users@reportlab.com
Mon, 23 Jun 2003 18:35:38 -0600


OK...  I was tired or trying to read everything sideways.
This puts the canvas in portrait before it does the translations and
drawing so everything is right side up now.

--Karl


# diff -u pythonpoint.py.bak pythonpoint.py
--- pythonpoint.py.bak  Mon Jun 23 15:36:32 2003
+++ pythonpoint.py      Mon Jun 23 18:33:39 2003
@@ -356,6 +356,9 @@
             print filename
         #canv = canvas.Canvas(filename, pagesize = pageSize)
         outfile = getStringIO()
+        if self.notes:
+            #translate the page from landscape to portrait
+            pageSize= pageSize[1], pageSize[0]
         canv = canvas.Canvas(outfile, pagesize = pageSize)
         canv.setPageCompression(self.compression)
         canv.setPageDuration(self.pageDuration)
@@ -374,8 +377,13 @@
                 print 'doing slide %d, id = %s' % (slideNo, slide.id)
             if self.notes:
                 #frame and shift the slide
-                canv.scale(0.67, 0.67)
-                canv.translate(self.pageWidth / 6.0, self.pageHeight / 3.0)
+                #canv.scale(0.67, 0.67)
+                scale_amt = (min(pageSize)/float(max(pageSize)))*.95
+                #canv.translate(self.pageWidth / 6.0, self.pageHeight / 3.0)
+                #canv.translate(self.pageWidth / 2.0, .025*self.pageHeight)
+                canv.translate(.025*self.pageHeight, (self.pageWidth/2.0) + 5)
+                #canv.rotate(90)
+                canv.scale(scale_amt, scale_amt)
                 canv.rect(0,0,self.pageWidth, self.pageHeight)
             slide.drawOn(canv)
             canv.showPage()

-- 
Karl Putland <karl@putland.linux-site.net>