I'm trying to create a Salesforce Lightning Web Component to create a custom Quote PDF using jsPDF. I mastered to use the external chart.js library with uploading it as a static resource, but when I try to do the same with jsPDF.js I always get a security error "SecureElement does not allow access to charset" while calling jsPDF.

Has anyone an answer to that or an alternative solution to create PDFs with Lightning Web Components?

  • Seems like jsPDF is not locker complaint . You might have to find alternative locker complaint workaround for unsupported apis – Mohith Shrivastava Mar 13 at 23:51
  • Hi @MohithShrivastava thank you for your answer. Unfortunately I thought so, do you have any hints for a PDF library that is Locker compliant? Thanks, Michael – Michael Mar 14 at 0:25
  • May be you should try building like a visualforce for your requirement and then you can render natively on the platform or attach as a file . – Mohith Shrivastava Mar 14 at 0:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.