0

ReactJS with jsPDF download does not render font-family.

jsPDF is working well on development but in the production version. I am facing a font-family missing issue after downloading the pdf. Showing below error in console.

Error while reading CSS rules from file:///Users/rahulshinde/Documents/hdfclife/offline-quote-fe/dist/assets/css/main.css SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules

Found some solutions online by adding the following attribute in link tag.

crossorigin="anonymous"

But it seems it required server to run code. I find this is not a good solution.

Rahul Shinde
  • 168
  • 3
  • 12

0 Answers0