Hacker News new | ask | show | jobs
by honzajde 1899 days ago
Saved PDF (in Chrome) does not have a TOC as a side pane in Acrobat Reader. MIssing pretty important feature.
2 comments

The bookmarks feature of pdfs doesn't exist in chrome's pdf engine which means paged.js don't support it either last I checked.

We solved this by post processing the pdf generated with paged.js + puppeteer with itextsharp (LGPL) to add the bookmarks.

We captured the toc using the paged.js "after" hook and put that into a variable which our backend could then grab from puppeteer.

Yes, that would be an advanced feature and I think likely out of the scope for paged.js. That said the table of contents page is hyperlinked - you can jump to sections, and I put a return to table of contents in the footer to aide with navigation. Hopefully that helps?