Spaces:
Running
Running
Update report_structure.py
Browse files- report_structure.py +3 -2
report_structure.py
CHANGED
@@ -84,7 +84,7 @@ def generate_report(research_output: str, filename="research_report.pdf"):
|
|
84 |
story.append(Paragraph(para.strip(), normal_style))
|
85 |
story.append(Spacer(1, 12))
|
86 |
|
87 |
-
doc.build(story)
|
88 |
return research_output
|
89 |
|
90 |
|
@@ -133,4 +133,5 @@ def add_page_number(canvas, doc):
|
|
133 |
"""Adds page numbers to the footer."""
|
134 |
canvas.saveState()
|
135 |
canvas.setFont('Times-Roman', 9)
|
136 |
-
canvas.drawString(letter[0] - 72,
|
|
|
|
84 |
story.append(Paragraph(para.strip(), normal_style))
|
85 |
story.append(Spacer(1, 12))
|
86 |
|
87 |
+
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number) #<-Pass the function here
|
88 |
return research_output
|
89 |
|
90 |
|
|
|
133 |
"""Adds page numbers to the footer."""
|
134 |
canvas.saveState()
|
135 |
canvas.setFont('Times-Roman', 9)
|
136 |
+
canvas.drawString(letter[0] - 72, 0.75 * 72, "Page %d" % doc.page) #<-Added Closing parenthesis
|
137 |
+
canvas.restoreState()
|