Skip to content

Can't use custom fonts properly #1863

@adrien-guyot

Description

@adrien-guyot

I am using the 1.4.1 version of jsPDF in my Angular 5 project.
I'm trying to add some custom fonts to my pdf but it's not working.
It throws the following error :

Font does not exist in FileInVFS, import fonts or remove declaration doc.addFont('nameOfTheFont').

So i tried to add files to VFS like this :

doc = new jsPDF();
doc.addFileToVFS(nameOfTheFont, FontBase64Encoded);

And it's not throwing errors anymore, the PDF is well generated but the font is not working at all in the pdf.

capture

Did I missed something ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions