Skip to content

Instantly share code, notes, and snippets.

@vipulyadav150
Created February 27, 2023 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vipulyadav150/75fb90488ce64c4f9d8064e9462b8a46 to your computer and use it in GitHub Desktop.
Save vipulyadav150/75fb90488ce64c4f9d8064e9462b8a46 to your computer and use it in GitHub Desktop.
function downloadPDF() {
var pdf = new jsPDF('p', 'pt', 'a4');
$("#button-pdf").attr('hidden', 'true')
pdf.addHTML($("#mainContainer"), 0, -20, { allowTaint: true, useCORS: true, pagesplit: false }, function () {
pdf.save('{{downloaded_file_name}}.pdf');
$("#button-pdf").removeAttr('hidden', 'true')
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment