python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.54k stars 1.11k forks source link

Clean way to create a multi-column document #1368

Open dawillcox opened 6 months ago

dawillcox commented 6 months ago

I want to create a document with multiple columns. Not table columns, but text flowing from bottom to top of columns in each page. I found a stackoverflow hack that let me do that, but that requires accessing a protected attribute of Section, generally considered a no-no.

It works, but isn't really supported, and could break in any future release. It would be awfully nice if there was a supported way to set column attributes for the section. I'm not sure what other related attributes ought to go along what that. Margins for each column maybe? Or different column widths? Just number of columns would work for me as a minimum.

It looks like I could do what I want using an original "template" document with the format I want, read it in, then add the text. But explicit support would be great.

This is a really handy project, by the way. Thanks!