Skip to main content

Posts

Showing posts from June 25, 2023

Convert any web page to pdf and save it to Server location - Using AJAX javascript and PHP

 Saving PDF file on local machine is easy - but  if you want to save it on server location - then we have two waays ..  1. Using JavaScript AJAX call ...  2. Using PHP  package -  wkhtmltopdf =====================1. JavaScript Way -============================ pdfmaker.php or .html  < div id = "kil" >       <!--  your can use URL or path for image -->           < img id = "kil2" src = "../folder/vasu.png" >     < p >         Kilvish is the Biggest villan of the Earth Planet.     </ p > </ div > <!-- Include the jsPDF library --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js" ></ script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js" ></ script > < script src = "https://code.jquery.com/jquery-3.5.1.min.js" ...