WebSite X5Help Center

 
Cf Guy
Cf Guy
User

Code to Force Automatic Download of pdf file, if Button/Link is Clicked by User?  en

Autor: Cf Guy
Visitado 851, Followers 1, Compartido 0  

Hi All,

 I've just designed my first person website using Website X5 Pro, and am new to the world of website development.

Through Website X5 Pro, I have discovered how to make a PDF file open in a separate window, if a user clicks on a button or link "such as download PDF Map", but  I realize that the user will have to take the extra step to actually download the PDF file onto their hard drive, if they want to save a copy of it.

Is there a way (perhaps through coding in Website X5 Pro, to instruct/force a PDF file to automatically download onto a user's computer, if they were to click a button or link such as "Download PDF Map", etc.?

 Just wondering if this is a possibility in the Website X5 Pro program.

Many thanks for any help or suggestions anyone has to offer about this topic.

 Thanks,
-Cfguy

Publicado en
1 RESPUESTAS
Daniel W.
Daniel W.
User
Usuario del mes EN

1) Activate HTML in the text object, see

2) Insert this HTML code in the text field and adjust the link address and link text. The addition "Download" is important.

<a href="downloads/html5-css-referenz.pdf" download>Download PDF</a>

3) And this is what the inserted HTML code looks like in the preview.

Leer más
Publicado en de Daniel W.