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>

Also see: Link to open PDF file in new tab