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

http://example.com/download-pdf-file-single-click.pdf

Create Text Hyperlink to download PDF

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

<a href=”http://example.com/download-pdf-file-single-click.pdf” 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=”http://example.com/download-pdf-file-single-click.pdf” download>Download PDF</button>

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

About the Author

SRINI S

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