Write the PDF document, multiple slides per page.
(self)
| 394 | |
| 395 | |
| 396 | def saveAsHandout(self): |
| 397 | """Write the PDF document, multiple slides per page.""" |
| 398 | |
| 399 | styleSheet = getSampleStyleSheet() |
| 400 | h1 = styleSheet['Heading1'] |
| 401 | bt = styleSheet['BodyText'] |
| 402 | |
| 403 | if self.sourceFilename : |
| 404 | filename = os.path.splitext(self.sourceFilename)[0] + '.pdf' |
| 405 | |
| 406 | outfile = getStringIO() |
| 407 | doc = SimpleDocTemplate(outfile, pagesize=rl_config.defaultPageSize, showBoundary=0) |
| 408 | doc.leftMargin = 1*cm |
| 409 | doc.rightMargin = 1*cm |
| 410 | doc.topMargin = 2*cm |
| 411 | doc.bottomMargin = 2*cm |
| 412 | multiPageWidth = rl_config.defaultPageSize[0] - doc.leftMargin - doc.rightMargin - 50 |
| 413 | |
| 414 | story = [] |
| 415 | orgFullPageSize = (self.pageWidth, self.pageHeight) |
| 416 | t = makeSlideTable(self.slides, orgFullPageSize, multiPageWidth, self.cols) |
| 417 | story.append(t) |
| 418 | |
| 419 | ## #ensure outline visible by default |
| 420 | ## if self.showOutline: |
| 421 | ## doc.canv.showOutline() |
| 422 | |
| 423 | doc.build(story) |
| 424 | return self.savetofile(outfile, filename) |
| 425 | |
| 426 | def savetofile(self, pseudofile, filename): |
| 427 | """Save the pseudo file to disk and return its content as a |
no test coverage detected