master
simon 4 years ago
commit 9ffe826db4

@ -0,0 +1,19 @@
from reportlab.lib.pagesizes import letter, A4
from reportlab.pdfgen import canvas
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
doc = SimpleDocTemplate("text.pdf", pagesize=A4,
rightMargin=72, leftMargin=72,
topMargin=72, bottomMargin=18)
content = []
styles = getSampleStyleSheet()
for i in range(10):
p = Paragraph('<font size=12>{}</font>'.format(i), styles["Normal"])
content.append(p)
content.append(Spacer(1, 12))
doc.build(content)
Loading…
Cancel
Save