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>