[Understanding the Difference between Bookmarks and the Outline in a PDF](https://pspdfkit.com/blog/2019/understanding-pdf-outline) [Creating a Table-of-Contents with PDF.js ](https://medium.com/@csofiamsousa/creating-a-table-of-contents-with-pdf-js-4a4316472fff) https://github.com/mozilla/pdf.js/tree/master/examples/node CreateOptions, addOutline, insertOutline ## Tools ### {Adoc, TOC.json} -> [] -> html1 ### html1 -> [] -> PDF1 ### PDF1 -> [toc.js] -> TOC.json * Parse PDF with `pdf.js` library https://github.com/mozilla/pdf.js * Measure page numbers for Chapters, Sections. * Number of pages ### {PDF1, TOC.json} -> [] -> PDF2 * based on printed PDF and TOC.json * parse PDF1 using `pdf-lib` https://github.com/Hopding/pdf-lib * add headers and footers. page numbers * add `Outline` using https://github.com/Hopding/pdf-lib/pull/486 * save modified `PDF2`
Understanding the Difference between Bookmarks and the Outline in a PDF
Creating a Table-of-Contents with PDF.js
https://github.com/mozilla/pdf.js/tree/master/examples/node
CreateOptions, addOutline, insertOutline
Tools
{Adoc, TOC.json} -> [] -> html1
html1 -> [] -> PDF1
PDF1 -> [toc.js] -> TOC.json
pdf.jslibrary https://github.com/mozilla/pdf.js{PDF1, TOC.json} -> [] -> PDF2
pdf-libhttps://github.com/Hopding/pdf-libOutlineusing PdfOutline (Outline/Bookmarking functionality) Hopding/pdf-lib#486PDF2