Download PDF file on single click [HTML]

PDF image of make PDF file downloadable on single click in html

If you want to add HTML code to download a PDF file on single click, then keep on reading.

If below is the PDF file path

Create Text Hyperlink to download PDF

then use below html code to create downloadable link on your site

<a href=”” download>Download PDF</a>

Above code creates a text hyperlink to your PDF file. When the user clicks on it, the PDF file will be downloaded directly to your downloads folder.

Also see change default download path

HTML button to direct download PDF file

If you want to add a HTML button to direct download PDF document, then use below code

<button type=”button” ><a href=”” download>Download PDF</button>

How to create a link to open a PDF file in new tab [HTML]

About the Author


A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps