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

Headings marked as index item does not put text in PDF outline items #2430

Closed
cdokolas opened this issue Jun 19, 2023 · 7 comments
Closed

Headings marked as index item does not put text in PDF outline items #2430

cdokolas opened this issue Jun 19, 2023 · 7 comments
Assignees
Milestone

Comments

@cdokolas
Copy link

I'm marking headers as index items (non-concealed) and I noticed that the PDF outline now has blank section items (untitled).

I'm using current asciidoctor-pdf and all gems freshly updated on Windows 11. Also, section-refsig and chapter-refsig have been unset.

There is a workaround, making the header names normal and duplicating them as concealed index items, but this must be a bug none the less.

@mojavelinux
Copy link
Member

This is not the behavior I observe. I expect that the outline will use the text from the non-concealed index term.

Please provide a concrete example that I can test, as it may provide details that you are not mentioning that are affecting the behavior. Also, please report which version of Asciidoctor PDF you are using (asciidoctor-pdf -v).

@cdokolas
Copy link
Author

Hope this helps...

Asciidoctor PDF 2.3.7 using Asciidoctor 2.0.20 [https://asciidoctor.org]
Runtime Environment (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]) (lc:IBM437 fs:UTF-8 in:UTF-8 ex:UTF-8)

Sample document:

= PDF Outline Bug Reproduction
:doctype: book
:outlinelevels: 4:1
:sectnums:

== ((This is a Chapter))

This is Chapter 1.

=== ((This is a Section))

==== ((This is a Sub-Section))

Command used to convert: asciidoctor-pdf -t -b pdf -o "outline.pdf" "outline.adoc"

Keep up the good work!

@mojavelinux
Copy link
Member

The nuance is that this seems to happen when sectnums is enabled, which is rather surprising. I'll take a closer look.

@mojavelinux
Copy link
Member

FYI, -b pdf is redundant when using the asciidoctor-pdf command.

@mojavelinux
Copy link
Member

This appears to be a bug in either Prawn or the PDF format. When there's a null character in the value of an outline, it stops showing the text after that point. We'll have to remove the null character (which is used internally as a placeholder for the index term).

@mojavelinux
Copy link
Member

mojavelinux commented Jun 21, 2023

The null character is making it to the PDF, so it must be the PDF reader that's tripping up on it.

In fact, it may even be a limitation of evince (or whatever it's built on). I don't see the same issue when using the Firefox PDF viewer.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 21, 2023
@mojavelinux mojavelinux self-assigned this Jun 21, 2023
@mojavelinux mojavelinux added this to the v2.3.x milestone Jun 21, 2023
@mojavelinux
Copy link
Member

I'll backport this to the v2.3.x release line.

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

No branches or pull requests

2 participants