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

Undefined CHARARRAY encountered and treated as an empty string - Logs #275

Open
roshan9419 opened this issue Jan 17, 2022 · 3 comments
Open

Comments

@roshan9419
Copy link

Is there any way to avoid these logs which are printed whenever pdf is generated?

Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.
Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.
Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.
Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.

I'm using these internal fonts of the library and one Roboto font:

const fontStyle1 = { fontSize: 8, font: require('pdfjs/font/Helvetica') };
const fontStyle2 = { fontSize: 8, font: require('pdfjs/font/Helvetica-Bold') };
const fontStyle3 = { fontSize: 12, font: new pdf.Font(fs.readFileSync(path.join(__dirname, '/assets/roboto_bold.ttf'))) };

Here, I'm using Roboto font in one line only (for Unicode char purpose), and the rest are of Helvetica.

@rkusa
Copy link
Owner

rkusa commented Jan 24, 2022

It looks like the log comes from the opentype.js dependency. The source doesn't seem to suggest any option to disable the log. So I am afraid that there is no way to turn them off other than using your own modified version of opentype.js or trying to fix the font.

@roshan9419
Copy link
Author

Yeah, let me try to use some other fonts.

@Connum
Copy link

Connum commented Nov 27, 2023

This shall be fixed once we implement opentypejs/opentype.js/#648

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

3 participants