PDA

View Full Version : Including page nos. in .odt file with QTextDocument



PradeepP
12th August 2019, 09:12
Hello
I am using QTextdocument and QTextdocumentwriter to create .odt file. I want to include page nos. at the end of each page in .odt file. I saw people have done it with QPainter but then it is for .pdf files. I tried to use QPainter but it does not support .odt file format. Can anybody help me with some solution here?
Thanks,

d_stranz
13th August 2019, 16:50
Here is some code on github (https://gist.github.com/chris-marsh/242b6229c7c8d2ed687833db3087793f) that supposedly allows insertion of headers and footers into a QTextDocument during printing. Maybe it will help. BTW, I googled "QTextDocument pagination" and this was the third hit. There are probably other solutions out there as well.