Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.
This repository was archived by the owner on Feb 28, 2019. It is now read-only.

Buggy output when opened with muPDF #47

@kwshi

Description

@kwshi

When an external font is embedded in the PDF, it cannot be opened in muPDF correctly:
jspdf-mupdf-font
Expected output:
jspdf-evince-font

muPDF also logs the following:

error: freetype: cannot load font: invalid stream operation
warning: ignored error when loading embedded font; attempting to load system font

The code to embed the fonts is as follows:

const pdf = new jsPDF();
pdf.addFileToVFS("Roboto-Regular.ttf", ROBOTO);
pdf.addFileToVFS("Roboto-Bold.ttf", ROBOTO_BOLD);
pdf.addFont("Roboto-Regular.ttf", "Roboto", "normal");
pdf.addFont("Roboto-Bold.ttf", "Roboto", "bold");

Here is the PDF in question:
hyperschedule-color.pdf

Other PDF viewers can open the file correctly, so this may be a problem with muPDF. On the other hand, muPDF has also been fine with opening other PDFs with embedded fonts in the past, so I think the problem is not with only muPDF. I suspect that there is some protocol that this library is not following entirely and that other PDF viewers have managed to correct for these errors in a way that muPDF hasn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions