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

PDF: Add a Table of Contents to the metadata #47

Open
danburzo opened this issue Oct 16, 2018 · 9 comments
Open

PDF: Add a Table of Contents to the metadata #47

danburzo opened this issue Oct 16, 2018 · 9 comments

Comments

@danburzo
Copy link
Owner

danburzo commented Oct 16, 2018

A PDF generated from many web pages would benefit from a Table of Contents, implemented as PDF bookmarks. We'll probably need to post-process the PDF with something like HummusJS to write the TOC. (Also, I'd appreciate if someone with more experience would explain whether its license is compatible with our MIT License)

Related: #25

@danburzo danburzo added Feature New feature or enhancement Available This issue is up for grabs labels Oct 16, 2018
@klappy
Copy link

klappy commented Oct 22, 2018

Thanks @danburzo for all of your hard work on this project.

I wanted to share that this library looks really promising for our use case of a CI publication pipeline that generates PDFs. We have explored leveraging html/css and converting to PDF and it gets us 80% of the way there. Other features such as page-sandboxed footnotes are also very hard to come by.

Our current biggest obstacle is just what you stated here, we are unable to generate a ToC. The libraries that do handle ToC are proprietary and typically not compatible to be distributed with our open source software.

We will be watching this project and even willing to contribute when opportunity arises.
Thanks again!

@danburzo
Copy link
Owner Author

We may be able to have some luck with Apache PDFBox, but it's written in Java and I'm not sure yet if/how we'll be able to use it.

@guybedo
Copy link
Contributor

guybedo commented Oct 29, 2018

I've implemented a basic TOC functionnality: #81

Not sure that's what you had in mind, but for my use case it's gonna be usefull, hope it helps.

@danburzo
Copy link
Owner Author

Hi @guybedo, thank you for the contribution! This issue specifically refers to a PDF functionality to show an Outline in the PDF structure itself rather than a separate page in the PDF. But your addition is very welcome as well :-)

@larryboymi
Copy link

@danburzo did you get this working? Looking to do something similar with hummusJS

@danburzo
Copy link
Owner Author

@larryboymi — unfortunately, no. I'm currently caught in dayjob work, and did not have a chance to explore this further. Any sort of insight / contribution on this subject is greatly appreciated!

@larryboymi
Copy link

Thanks for responding... I think I'll try to create an example with hummus and then share with you... Was just hoping to shortcut lol

@larryboymi
Copy link

larryboymi commented Apr 4, 2019

I created an npm module with this functionality. Check it out and give feedback, thanks! I'll try to add some examples of how to do it in your regular flow, but the base index.js file shows the usage.

@danburzo danburzo changed the title Add a Table of Contents to the PDF Add a Table of Contents to the PDF metadata Jul 30, 2020
@danburzo danburzo changed the title Add a Table of Contents to the PDF metadata PDF: Add a Table of Contents to the metadata Jul 30, 2020
@danburzo
Copy link
Owner Author

Chrome 85 / puppeteer 5.2.1 you can produce tagged PDFs, and it seems an outline based on that is in the works

@danburzo danburzo removed Available This issue is up for grabs Feature New feature or enhancement labels Jul 31, 2020
danburzo added a commit that referenced this issue Jul 31, 2020
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

4 participants