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

Easy table of content feature with go to links and page numbers #1249

Open
SuperPat45 opened this issue Dec 20, 2024 · 0 comments
Open

Easy table of content feature with go to links and page numbers #1249

SuperPat45 opened this issue Dec 20, 2024 · 0 comments

Comments

@SuperPat45
Copy link
Contributor

SuperPat45 commented Dec 20, 2024

Is your feature request related to a problem? Please describe.
I need to generate a PDF containing a table of content with go to links and page numbers at the beginning of the document.

Describe the solution you'd like
It would be amazing to have a way to insert a page number of a bookmark that was not currently known. Maybe something like this could be done to fill the table of content with page number:

final Paragraph par = new Paragraph();
final Chunk c = new Chunk(chapTitle));
c.setLocalGoto(bookmark);
par.add(c);
par.add(new Chunk(new DottedLineSeparator()));
par.add(new Chunk(new BookmarkPageNumber(bookmark));
summaryChapter.add(par);

I imagine a class BookmarkPageNumber taking a bookmark name as parameter and will write the page number when the document is closed.

Describe alternatives you've considered
The only way I found is to insert the table of content at the end of the book.

Your real name
no

Additional context

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

1 participant