Open
Description
I need to apply below function in document on specific page.
Function purpose is to set up specific style and margins settings. I mark this page with paragraph (see screenshot).
How I can identify this page in function to apply in only on the page with marker?
I would really appreciate your help!
def set_up_doc(doc, fund_name, section_index=0):
# Apply styles to the specified section
section = doc.sections[section_index]
# Set paragraph spacing
paragraph_format = doc.styles['Normal'].paragraph_format
paragraph_format.space_after = Pt(0.1)
# Set font name and size
style = doc.styles['Normal']
font = style.font
font.name = 'Arial'
font.size = Pt(9)
# Set up margin width for the section
section.top_margin = Cm(2.12)
section.bottom_margin = Cm(2.01)
section.left_margin = Cm(0.88)
section.right_margin = Cm(1.02)
return doc
Metadata
Metadata
Assignees
Labels
No labels