pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

Undefined CHARARRAY encountered and treated as an empty string - Logs

Open roshan9419 opened this issue 2 years ago • 3 comments

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.

roshan9419 avatar Jan 17 '22 12:01 roshan9419

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.

rkusa avatar Jan 24 '22 08:01 rkusa

Yeah, let me try to use some other fonts.

roshan9419 avatar Jan 25 '22 05:01 roshan9419

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

Connum avatar Nov 27 '23 21:11 Connum