html-export-pdf-cli is a PDF that can generate an outline from an HTML file. But in this commit [Drop Paged.js](a16a3ed#diff-7ae45ad102eab3b6d7e7896acd08c427a9b585b346470d7b56 5) Removed support for it. why is that?
First of all, Paged.js is a paging engine implemented using JavaScript, which can convert HTML and CSS tags into paginated documents, so that the content on the Web can be displayed in print or PDF output Realize pagination effect.
html-export-pdf-cli mainly uses its layout effect and then uses document.querySelectorAll("h1,h2,h3,h4, h5,h6")
to generate an outline.
If the layout and resulting PDF are not uniform, other interfering text may prevent outline acquisition and generation.
Because Paged.js will change the style and layout of the webpage, which is different from the default one. After thinking about it, it was removed. If necessary, it can be introduced through Additional Scripts and Additional Styles.
In addition, in addition to the easy-to-use Paged.js, you can also choose vivliostyle.js to achieve your own printing Layout and other effects.