- Package:
- src:poppler
- Source:
- poppler
- Submitter:
- "brian m. carlson"
- Date:
- 2026-07-02 17:44:08 UTC
- Severity:
- normal
- Tags:
I have a PDF including bookmarks automatically generated from DocBook part and article titles. One part has an empty title, and although a bookmark is created for it, neither evince nor okular display that part or any of its subparts in the bookmark listing. Obviously, this makes navigation more difficult. To illustrate the matter clearly, I've included the DocBook 5 source as well as the PDF in question. If you look at the contents of the PDF (say, in less), a bookmark is generated for each DocBook part and article, including the one with the empty title. I think that poppler and the programs that use it should display the full bookmark tree, even if the title of one of the parts is empty. Please let me know if you need more information or if you need me to test something.
I've looked at the source and I see that in poppler's OutlineItem::OutlineItem, titleLen is set to 0 if the item's Title key is not a string. This is a problem since 0 is a valid length, but it's being used as an indication that the OutlineItem is not valid. I'm not sure that there's an easy way to fix this, but it should definitely be forwarded upstream so that it can be fixed in a consistent way that will work in all the poppler-using programs.
tags 639614 + patch kthxbye To fix this bug, I first tried to make sure that the title member of OutlineItem was non-NULL if titleLen is 0. This, unfortunately, does not fix the problem. Neither okular nor evince render the missing outline trees. It's unclear to me what is intrinsically preventing them from rendering outline items with a zero-length title, since this is perfectly valid according to PDF 1.4. As a workaround, I've changed the code so that if the length of the string is 0, to create a string containing only the Unicode character U+200B, ZERO WIDTH SPACE. This works in both programs, but it's really just a hack. The code should be fixed to do something sane and reasonable, but I'm not familiar enough with it to determine what that should be (although it very well may break the ABI, which is even more reason for a deliberate and well-thought-out decision).
Control: forwarded -1 https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/1427 Control: tags -1 +patch A patch submitted upstream.