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.
![image.png](https://camo.githubusercontent.com/9bffc0f348ecdb30e931d3b1e63f1a98a97d5d5bac77a9df30ffe04a4e39b6ec/68747470733a2f2f70332d6a75656a696e2e62797465696d672e636f6d2f746f732d636e2d692d6b3375316662706663702f62303837333638326235333934633836396533653434313036613966616338667e74706c762d6b3375316662706663702d77617465726d61726b2e696d6167653f)
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.