Download document from a button

Hello team, I have this question, how can I download a document from an external button to pdftron like this example

Hi there,
Assuming you have a HTML button element with an ID download-button, here is how you can download through that button:

WebViewer(
  //...initial options
).then(instance => {

  document.getElementById('download-button').addEventListener('click', e => {
    instance.UI.downloadPdf()
  })

});