Open jakubmirejovsky opened 1 year ago
Hi there, @jakubmirejovsky, I have exactly the same problem, did you found solution for this?
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 https://github.com/mozilla/pdf.js/issues/4244#issuecomment-1232548915
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/');
Same problem here. I got a blank white pdf.
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/';
orconst standardFontDataUrl = join(__dirname, '../../../node_modules/pdfjs-dist/standard_fonts/');
Works for me! Thank you.
Please try v3.3.0
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! :)