Unsolved How to create a table of contents with QTextDocument
-
Hello Qt friends,
I would like to know if there is a way to create a table of contents in a QTextDocument.
I have tried with HTML anchor <a href="#ref"> tag, which works well with QTextBrowser, but when saving as PDF file the links don't work, even when saving as ODT, so I would like to know if through Qt's own classes it is possible to create a table of contents, or maybe you can recommend me to use an external library.
-
Hi
As far as i know its not possible to make real PDF bookmarks in Qt
Ther was talk about it and there is a patch
https://bugreports.qt.io/browse/QTBUG-3893
but that jonas person seems to have vanished and so is patch.I think http://podofo.sourceforge.net/
can create bookmarks but i never tried it.Also
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
can do bookmarks via commandline so if its an option to call it using QProcess as a post processor that could
also maybe be a solution. -
Thank you. I will check those libraries.