Hello,
Thanks again for such an awesome library. I've been using it for multiple production systems for a while now with absolutely no issues - really appreciate all of your effort on this.
After upgrading to a newer version of PyMuPDF, using pdf.setToC() to add bookmarks to any PDF that has existing bookmarks in it runs without any exceptions, but the result PDF's bookmarks do not appear when opening the PDF using GNOME Document Viewer/evince or Adobe Acrobat.
The bookmarks seem to be viewable when using Chrome. Calling pdf.getToC() on the result PDF also shows that the bookmarks are present, per the library.
This issue only seems to appear in PyMuPDF versions 1.18.7 or 1.18.8. It ONLY seems to appear when the input PDF has existing bookmarks; when using a PDF without any bookmarks everything renders OK.
Sample PDF and replication script are attached.
test.pdf
script.py.txt
Bookmarks are viewable.
Input PDF bookmarks:

Output PDF has no bookmarks:

Good timing - I planned to publish the next version this weekend.
Let me see if this can be resolved quickly enough.
Thanks for the well prepared material!
Found it - although I don't understand what the hell is bothering Adobe.
You may know, that set_toc _always_ removes the old TOC and builds a completely new one.
As I am a performance freak, I tried an earlier idea again: re-use the freed xrefs that the old TOC had beeen using.
Switching the respective instruction off, calmed down Adobe again.
So you can download the improved version on Monday latest ...
Sounds good; no rush or urgent need from my end. Thanks for the quick attention.
Fixed in v1.18.9 currently being uploaded.