What I wanted to do is to assign different alignment and font styles to my docx header. The first header should be aligned left and the 2nd header should be centered. The header should be visible on all pages so I can't use something like add_paragraph(). I also need to set the font size to 20
It should be something like this: Sample Output
Here's my code currently:
header_text = doc.sections[0].header.paragraphs[0]
header_text.text = ""
header_text.add_run('Main Header 1').alignment = WD_ALIGN_PARAGRAPH.LEFT
header_text.add_run('\n\n')
header_text.add_run('Sub Header 2').alignment = WD_ALIGN_PARAGRAPH.CENTER