Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookmarks not rendering in evince/Acrobat when adding to PDFs with existing bookmarks #922

Closed
smithct2 opened this issue Feb 26, 2021 · 4 comments
Assignees
Labels

Comments

@smithct2
Copy link

smithct2 commented Feb 26, 2021

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.

Describe the bug (mandatory)

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.

To Reproduce (mandatory)

Sample PDF and replication script are attached.
test.pdf
script.py.txt

Expected behavior (optional)

Bookmarks are viewable.

Screenshots (optional)

Input PDF bookmarks:
image

Output PDF has no bookmarks:

image

Your configuration (mandatory)

  • Ubuntu 20.04 (also tested with same result on Oracle Linux 7.8), both 64-bit
  • Python 3.7.3, 64-bit
  • PyMuPDF 1.18.7 or 1.18.8, installed via pip/wheel
  • evince version 3.36.7
  • Acrobat version 2021.001.20135
@JorjMcKie
Copy link
Collaborator

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!

@JorjMcKie
Copy link
Collaborator

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 ...

@smithct2
Copy link
Author

Sounds good; no rush or urgent need from my end. Thanks for the quick attention.

@JorjMcKie
Copy link
Collaborator

Fixed in v1.18.9 currently being uploaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants