Skip to content
New issue

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

Fallback fonts #28

Open
jakubmirejovsky opened this issue Mar 1, 2023 · 3 comments
Open

Fallback fonts #28

jakubmirejovsky opened this issue Mar 1, 2023 · 3 comments

Comments

@jakubmirejovsky
Copy link

Hi, is there any correct way to tell the converter to fallback fonts if the glyphs can't be rendered - per glyph?
Related issues:

Example of file which renders poorly: https://drive.google.com/file/d/1Z-cF3Vba1rbFCM6Qj5iDttqs9aquYGJi/view?usp=share_link

I tried disableFontFace true, false, useSystemFonts both true and false. No combination returned a correct render.

Any help will be appriciated! :)

@troyqa
Copy link

troyqa commented Apr 25, 2023

Hi there, @jakubmirejovsky, I have exactly the same problem, did you found solution for this?

@lbhmygod
Copy link
Contributor

lbhmygod commented Aug 9, 2023

Hi, hope my experience can help you.

I use this package to convert pdf, but recently I found some pdf texts are missing after conversion. So I tried to debug this, and set verbosityLevel to 5 to show all logs. And I found this error in log:

Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Regular.ttf" with "UnknownErrorException: Unable to load font data at: ../node_modules/pdfjs-dist/standard_fonts/LiberationSans-Regular.ttf".

Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Helvetica_path_T.".

After several hours no-use trying to add missing font, I realized this error is thrown by its dependent pdf.js package, and as they said, they have fixed this issue by adding default font, but we need to reference correctly mozilla/pdf.js#4244 (comment)

So I change this line const standardFontDataUrl = '../node_modules/pdfjs-dist/standard_fonts/'; in my local, and it works! Everything renders correctly! You can either change it to
const standardFontDataUrl = './node_modules/pdfjs-dist/standard_fonts/';
or
const standardFontDataUrl = join(__dirname, '../../../node_modules/pdfjs-dist/standard_fonts/');

@fabianobonomini
Copy link

Same problem here. I got a blank white pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants