MCPcopy Create free account
hub / github.com/Distrotech/reportlab / saveAsHandout

Method saveAsHandout

tools/pythonpoint/pythonpoint.py:396–424  ·  view source on GitHub ↗

Write the PDF document, multiple slides per page.

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

saveMethod · 0.95

Calls 7

buildMethod · 0.95
savetofileMethod · 0.95
getStringIOFunction · 0.90
SimpleDocTemplateClass · 0.90
makeSlideTableFunction · 0.85
appendMethod · 0.80
getSampleStyleSheetFunction · 0.70

Tested by

no test coverage detected