-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PDF creation fails with custom fonts using new version of pdfmake #821
Comments
@sklinga sounds like maybe the font has no |
@devongovett I can not share Univers font file due to licensing restrictions, but, I tried with the below font and I got the same issue Thanks again for you help! |
On further debugging, looks like it is failing decoding the name table. I see below error Uncaught Error: Encoding '_sbcs' has incorrect 'chars' (must be of len 128 or 256)(…) Strangely, when I run the code to create PDF with the same custom fonts as standalone outside our big app code base, it works fine. Any help/pointers on this issue is greatly appreciated! |
Pdfmake v0.1.24 using the newer fontkit library, that are probably some bugs. :( We must wait until it fix @devongovett. |
@devongovett Please also see this bug #818 |
No reaction. |
I had exactly the same problem (old version <0.1.20 works but not new one) and adding |
Sorry for the very long delay in responding. We had to put this upgrade aside for sometime. Adding meta tag to the header did not solve the issue in my case. I had to add the charset attribute to the script tag that is loading the pdfmake.js
pdfmake.js and few other libraries are concatenated in to dependencies.js file. Thanks everyone for the inputs, I appreciate the help. |
We have a working code base to create PDF using custom fonts(Univers) with pdfmake-0.1.17.
We want to use pdfmake-0.1.23 or later for the custom links fix but we are seeing the below error with the custom fonts, is there anything changed with fonts in latest release?
TypeError: Cannot read property 'records' of undefined
at TTFFont.get (pdfmake.js:50606:28)
at new EmbeddedFont (pdfmake.js:70666:29)
at Function.PDFFont.open (pdfmake.js:37654:15)
at PDFDocument.font (pdfmake.js:37593:29)
at FontProvider.provideFont (pdfmake.js:19881:56)
at pdfmake.js:21351:28
at Array.forEach (native)
at measure (pdfmake.js:21338:14)
at TextTools.buildInlines (pdfmake.js:21145:18)
at DocMeasure.measureLeaf (pdfmake.js:20768:29)
Appreciate any help with this issue.
Regards,
Sunil
The text was updated successfully, but these errors were encountered: