Adding conditional page break by hand
Closed this issue · 1 comments
lucbouge commented
Dear 4teamwork,
Thank you for your very good tool. I have been looking for it for a long time, as python-docx
is much too low level for a simple concatenation.
I my case, I would like to concatenate several documents so that the first page of each document starts on a page whose number is 4*n +1. The reason is that I want to print it 2-side, 2 pages per side.
It would be easy to do it by inserting conditional page breaks between the appends.
master = Document("master.docx")
composer = Composer(master)
doc1 = Document("doc1.docx")
... test the current page number, add the right number of page breaks ...
composer.append(doc1)
composer.save("combined.docx")
Are the methods of python-docx
available on the composer
object?
Regards,
Luc.
de-adshot commented
doesn't your format and styles and other arts inserted get disrupted?
When I try to combine it does.