I have a webpage where when user clicks a button it generates an url to a pdf document. Then a pop-up is displayed where the user can click a button to see the pdf document in another tab and another button that downloads the document (without opening it).
I can't get the last one to work. I know that the a tag "download"
attribute does the thing but not sure how to add such attribute to an existing element.Tried using an html embeded component and tried to add the attribute by getting the element by Id but doesn't work either since the element id it's not the same as in the editor.
Just link the pdf to a element on the page, no need for popup.
https://support.wix.com/en/article/adding-a-link-to-an-element-6404699
Document: A specific document that you upload to your site. The document is downloaded when the user clicks the linked element. Choose the file.
Or are you doing something like this:
Web Address: An external website or URL. Enter the URL and select if it opens in a new or the current window. Note: If your URL link contains an unsupported character, the following error message is displayed: Please fill in a valid URL. To bypass the validation, use a link shortening service such as bit.ly or goo.gl.
Another option would be to just have a popup with the pdf viewer app on it and then let them view the pdf and download the pdf too, all through the viewer itself, no need to have so many buttons and options.
https://www.wix.com/app-market/pdf-viewer/overview