Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Button to Download a pdf file

I have a HTML button and I want it to download the pdf file by pressing it. Thank you

       <div class="columns download">
          <p>
             <a href="images/Portfolio.pdf" class="button"><i class="fa fa-download"></i>Download CV</a>
          </p>
       </div>
like image 473
João Guerreiro Avatar asked Nov 11 '15 04:11

João Guerreiro


People also ask

How do I add a download button to a PDF?

First, navigate to your page or post where you want your PDF download button in WordPress. On the page, add a new block and search for Button. Select the Button block to create a download button, then adjust the button position. Last, click the Link button on the toolbar, and paste the URL you copied in step one.

How do I download to a PDF file?

Open the file you want to save as a PDF. Tap File on your Android, then select Print. Select from the dropdown menu and click Save as PDF, then click Save. Pick your preferred location for your PDF and press Save.

How do you create a button that submits a form and downloads a PDF simultaneously?

Firstly, create a form with the hidden submit button. Give id to the form submit button to access it using JS. Create a button outside the form and also give it a unique id to access it. Make an anchor tag using createElement property and assigning it the href and download attribute.


1 Answers

 <div class="columns download">
          <p>
             <a href="images/Portfolio.pdf" class="button" download><i class="fa fa-download"></i>Download CV</a>
          </p>
       </div>
like image 102
Rakin Avatar answered Sep 28 '22 23:09

Rakin