I have a webpage that I made using PHP and HTML with CSS, it is a document, When I try to save the doc as a PDF using Ctrl + p it works perfectly, but I want to add a button to the webpage that automates this task, when the user clicks that button, the PDF will be generated.
I tried Html2pdf.js
but it just takes a screenshot of the page, is there any other method to generate PDF with selectable text? Or maybe automate the ctrl+p, remove header and save as PDF.