I have been using the Plumsail export to pdf (JavaScript built in feature) for some time as advised in a previous post, plus using some help from this link:
https://plumsail.com/docs/forms-web/how-to/export-to-pdf-setup.html
However, the pdf output doesn't look good as our forms are big and complicated.
I am looking into other options like using external JS libraries to convert to pdf like: html2pdf and jsPDF
I have referenced external JS libraries before using the require method, and it was working fine. However, with these 2 libraries, I am getting an error like: "html2pdf is not defined" or "jsPDF is not defined".
A simple code which is not working in a Plumsail form JS:
require(["https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"], function(){
$('#exportPDF').click(function(){
var element = document.getElementsByClassName('page-template')[0];
html2pdf(element);
});
});
Please note I tried this code in an external html/JS file and it worked fine, only in Plumsail I get this error.
Please advise.