title: Access PDF hyperlinks with pdf.js
body: <p>Im using pdf.js to parse a PDF generated from a Google Doc using Google Scripts. I need to ultimately produce a list of the hyperlinks on a given page of the pdf.</p>
  
  <p>I need an equivalent to the pdf.js function <code>PDFpage.getTextContent</code> but which includes hyperlink information, not just text information. Any function within pdf.js that outputs hyperlink information would be a start, but I can't seem to find anything.</p>
  
  <p>I don't need to display the PDF, just extract minimal information from it.</p>
  
  <p>My current code, which just logs the text content of the page:</p>
  
  <pre><code>function numbersLinks(blob) {
      PDFJS.getDocument({data: blob}).then(function (PDFdoc) {
        for (var i=1; i&lt;=PDFdoc.numPages; i++) {
          PDFdoc.getPage(i).then(function (PDFpage) {
          var page_number = PDFpage.pageIndex + 1;
            PDFpage.getTextContent().then(function (text) {
              for (var j in text.items) {
                var item = text.items[j]
                console.log(item)
              }
            })
          })
        }
      })
    }
  </code></pre>