We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to use customfonts in React app, but I can't import the default_vfs file to my project
import jsPDF from 'jspdf'; import 'jspdf-customfonts';
I also tried to import default_vfs file like:
import jsPDF from 'jspdf'; import 'jspdf-customfonts'; import 'jspdf-customfonts/dist/default_vfs';
But it doesn't work, console error repoting is
Uncaught ReferenceError: jsPDF is not defined
I don't konw what should I do to make it work properly
The text was updated successfully, but these errors were encountered:
Why you important jspdf-customfonts?
Sorry, something went wrong.
You don't need to import jspdf-customfonts as addFileToVFS is built in jsPdf itself
addFileToVFS
You can use jspdf-customfonts as a tool for making base64 from from ttf file (node makefonts.js) then just use generated data in jsPdf.
const someFont = 'AAEAAAASAQAABAAgRkZUTW...' doc.addFileToVFS('some-font.ttf', someFont) doc.addFont('some-font.ttf', 'some-font', 'normal') doc.setFont(`someFont`)
No branches or pull requests
I want to use customfonts in React app, but I can't import the default_vfs file to my project
I also tried to import default_vfs file like:
But it doesn't work, console error repoting is
Uncaught ReferenceError: jsPDF is not defined
I don't konw what should I do to make it work properly
The text was updated successfully, but these errors were encountered: