Posted by Roberto Alsina on Thu 4 Jun 12:49
report abuse | download | new post
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
- from reportlab.platypus.doctemplate import IndexingFlowable
- from reportlab.lib.styles import getSampleStyleSheet
- from reportlab.rl_config import defaultPageSize
- from reportlab.lib.units import inch
- PAGE_HEIGHT=defaultPageSize[1]; PAGE_WIDTH=defaultPageSize[0]
- styles = getSampleStyleSheet()
- def go():
- doc = SimpleDocTemplate("phello.pdf")
- Story = [Spacer(1,2*inch)]
- style = styles["Normal"]
- for i in range(10):
- bogustext = ("This is Paragraph number %s. " % i) *20
- p = Paragraph(bogustext, style)
- Story.append(p)
- Story.append(Spacer(1,0.2*inch))
- doc.multiBuild(Story)
- go()
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.