title: Creating image (PNG or JPEG) from PDF along with HTML image maps of text in the image?
body: <p>I am documenting a system I maintain. This documentation contains a diagram I created in TeX/TikZ which gets rendered to a PDF file. Then I convert the PDF file to an image file (PNG via imagemagick), and include it in my HTML documentation. Works great.</p>
  
  <p>Now I would like to create an <a href="https://en.wikipedia.org/wiki/Image_map" rel="nofollow noreferrer">image map</a> for the image, so that I can add hyperlinks/mouseovers/etc. This is an image that I expect to update periodically based on changes in my system, so I would like to automate this process if possible.</p>
  
  <p><strong>Is there a way to use a software library or tool to automatically create image maps of the various text content in the PDF file, when it gets rendered to PNG?</strong></p>
  
  <p>Here is an example from <a href="https://gist.github.com/jason-s/de6612727f2f76c0e495614db6014114" rel="nofollow noreferrer">this gist</a> I created:</p>
  
  <p><a href="https://i.stack.imgur.com/HIWpL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HIWpL.png" alt="enter image description here"></a></p>
  
  <p>In this case I would like to turn some of the various text strings into hyperlinks by locating their bounding box in the PDF:</p>
  
  <ul>
  <li><code>controller</code></li>
  <li><code>actuator</code></li>
  <li><code>sensor</code></li>
  <li><code>A</code></li>
  <li><code>B</code></li>
  <li><code>C</code></li>
  <li><code>D</code></li>
  <li><code>u</code></li>
  <li><code>y</code></li>
  <li><code>F(s)</code></li>
  <li><code>G(s)</code></li>
  <li><code>H(s)</code></li>
  </ul>
  
  <p>(They are all text content in the PDF file; I can select the text of any of them in Acrobat Reader and copy + paste into my text editor.)</p>
  
  <p>Is there a way to do this?</p>