Два столбца и нижний колонтитул с reportLab - PullRequest
1 голос
/ 17 января 2020

Я пытаюсь создать документ с двумя столбцами и нижним колонтитулом. В настоящее время у меня есть документ, разделенный на две колонки, однако, когда я пытаюсь сделать абзацы внутри нижнего колонтитула, он просто следует шаблону колонки, если это имеет смысл. Это на самом деле не создает нижний колонтитул. Я новичок в reportLab и у меня нет хорошей библиотеки asp.

document = SimpleDocTemplate("test.pdf", pagesize=letter,rightMargin=72,leftMargin=72,topMargin=72,bottomMargin=18 ) 

#Two Columns
frame1 = Frame(document.leftMargin, document.bottomMargin, document.width/2-6, document.height, id='col1')
frame2 = Frame(document.leftMargin+document.width/2+6, document.bottomMargin, document.width/2-6, document.height, id='col2')

document.addPageTemplates([PageTemplate(id='TwoCol',frames=[frame1,frame2])])

story = []

ptext = '* Example blah blah'
story.append(Paragraph(ptext, styles["Normal"]))

ptext = '* Example blah blah'
story.append(Paragraph(ptext, styles["Normal"]))


footer = Frame(document.leftMargin, document.bottomMargin, document.width, document.height, id="footer")
document.addPageTemplates([PageTemplate(id='Footer',frames=[footer])])

ptext = '* Example blah blah'
story.append(Paragraph(ptext, styles["Normal"]))

ptext = '* Example blah blah'
story.append(Paragraph(ptext, styles["Normal"]))


document.build(story)
...