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

Generate Table Of Contents (TOC) programmatically #2582

Open
aviau opened this issue Feb 6, 2024 · 3 comments
Open

Generate Table Of Contents (TOC) programmatically #2582

aviau opened this issue Feb 6, 2024 · 3 comments

Comments

@aviau
Copy link

aviau commented Feb 6, 2024

Hello,

The documentation says:

Tables of Contents are fields and, by design, it's content is only generated or updated by Word. We can't do it programmatically.

What would be needed to fix this? Is this even long-term-fixable?

Are there workarounds for this use case?

We have an app where:

  • We generate docx reports
  • We have also a download-as-pdf button where we use libreoffice to convert it from docx to PDF

For us, this is a dealbreaker and we would need to move away from docxjs if there is no long-term fix. We need our PDFs to have a TOC.

Thanks,

@aviau aviau changed the title Generate Table Of Contents programmatically Generate Table Of Contents (TOC) programmatically Feb 6, 2024
@anti-the-social
Copy link
Contributor

Even if constructor will be given, how would you think to calculate page numbers?

@josephmetabase
Copy link

Hello,

The documentation says:

Tables of Contents are fields and, by design, it's content is only generated or updated by Word. We can't do it programmatically.

What would be needed to fix this? Is this even long-term-fixable?

Are there workarounds for this use case?

We have an app where:

  • We generate docx reports
  • We have also a download-as-pdf button where we use libreoffice to convert it from docx to PDF

For us, this is a dealbreaker and we would need to move away from docxjs if there is no long-term fix. We need our PDFs to have a TOC.

Thanks,

hey, what did you end up using?

@aviau
Copy link
Author

aviau commented May 7, 2024

We put this project on hold right now. We are thinking of dropping docx support for our use case and move to a PDF with links.

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

No branches or pull requests

3 participants