-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Hi,
For more than 6 weeks I try to install this in my Angular project. I started 2 attempts but did not get any further with both.
1.) I worte a default_vfs.js file with:
(function (jsPDFAPI) { "use strict"; jsPDFAPI.addFileToVFS('PTSans-Regular.ttf', base64 encoded ttffile); }
I save it in src/assests/js
My problem here with is unknown, how I integrate this file into Angular and how I must call these, so that the fonts are loaded.
2.) My 2 idea is to create a service that inserts the fonts into the document.
`import * as jsPDF from 'jspdf';
@Injectable()
export class JsPDFFontService {
AddFont(doc: jsPDF) {
doc.addFileToVFS('PTSans-Regular.ttf', base64);
}
}`
Here I unfortunately get the message "addFileToVFS is not present in the type jsPDF".
Can someone help me here?