Hello,
Thanks for the code. The problem is that you are adding blank spaces in the anchor (and some DOCX readers may don't support them), and the element to generate the bookmark must be added after the element.
This is a simple sample:
$html = "
<html>
<body>
<br>UnisefPolicy 1
<h1>Sommario</h1>
<br>
<h4><a href='#1InformazioniGenerali'>1. Informazioni Generali</a></h4>
<h4><a href='#2SistemiInformativieSicurezzadeiDati'>2. Sistemi Informativi e Sicurezza dei Dati</a></h4>
<br>Other text<br>
<h3>1. Informazioni Generali</h3>
<div id='1InformazioniGenerali'></div>
<br>Other text<br>
<h3>2. Sistemi Informativi e Sicurezza dei Dati</h3>
<div id='2SistemiInformativieSicurezzadeiDati'></div>
</body>
</html>";
$options = array('parseAnchors'=> true,'baseUrl'=>'//','downloadImages' => true);
About showing the file path, it's the default behaviour of Word. We recommend you to use Table of contents to accomplish what you need.
Regards.