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>
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.
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.
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.
<div class="columns download">
<p>
<a href="images/Portfolio.pdf" class="button" download><i class="fa fa-download"></i>Download CV</a>
</p>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With