Solution 1 :

As for February 18, 2021 it’s not supported. Here is the related issue in chrome. Wkhtmltopdf has this feature but sometimes it doesn’t work well with modern js and HTML.

Problem :

I am writing a program to generate PDF files using html-to-pdf in headless chrome. But one of the requirements is that the generated PDF should be scrollable to some destination using pre-defined anchors. This can be achieved with named destinations or bookmarks in PDF. I am wondering whether that can be achieved in headless chrome.
I have seen some stack overflow questions regarding this and some answers are two years old. Does headless chrome support either bookmarks or named destinations now?

If so can I know how to add it in the HTML so the generated PDF will have bookmarks or named destinations?