-
Notifications
You must be signed in to change notification settings - Fork 813
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 Export with UTF-8 support #1539
Comments
Hey @marovargovcik Thanks for getting in touch. The lack of UTF-8 support is an issue, i agree with you there. At the moment the PDF downloader is depended on the autotable plugin, which is in-turn dependent on the jsPDF plugin. As with version 4.1 to be released shortly including more updates to the downloaders i would be unable to bring in a change soon as i don't want to force users to have to make whole sale changes to their code too often. but it is certainly something i would be interested in perusing later down the line. That being said, it is very easy to implement your own custom downloaders, so if you came up with a viable solution based on a different library that used the same design pattern as the existing downloader i would be happy to look at including it in Tabulator. In the mean time i will update the documentation to highlight the UTF-8 support issue, and with your permission include your workaround in the documentation if you would be happy with that. Thanks for getting in touch, Cheers Oli :) |
Thanks for your response @olifolkerd, I understand. And yes, you can use my example in the documentation but please be aware that not all fonts I tried to implement worked. Ubuntu fonts worked without problem but Roboto did not. Some of them work and some don't. I have very poor knowledge of how encoding and all these things about fonts work under the hood so I don't see a pattern why certain fonts are not working. Best regards. |
I have added a note about this in the docs and included a link to this issue incase it is helpful to others. Thanks for the workaround. Cheers Oli :) |
Please tell me which part to embed this code?
And I get the error: The function normally works only through |
Oli: you are the best. I love working with tabulator and I'm happy to help on smaller problems with dependencies. Of course I've already spend some funds on Patreon ;-)
<script src="assets/js/jspdf.min.js"}></script> <script src="assets/js/WorkSans-Regular-normal.js"></script> <script src="assets/js/jspdf.plugin.autotable.min.js"></script>3) set-up PDF-Download:
Done. |
This solution doesn't work with suggested version from documentation. since Export Works if I comment out <script type="text/javascript" src="/assets/plugins/tabulator-4.9.3/tabulator.min.js"></script>
<script type="text/javascript" src="/assets/plugins/tabulator-4.9.3/jspdf.min.js"></script>
<script type="text/javascript" src="/assets/plugins/tabulator-4.9.3/jspdf.plugin.autotable.js"></script> Export Doesn't work at all (jspdf is not a function) <script type="text/javascript" src="/assets/plugins/tabulator-4.9.3/tabulator.min.js"></script>
<script type="text/javascript" src="/assets/plugins/jsPDF-2.4.0/jspdf.umd.js"></script>
<script type="text/javascript" src="/assets/plugins/jsPDF-AutoTable-3.5.18/jspdf.plugin.autotable.min.js"></script> Unfortunately answer from MyDino doesn't help either, as they have forgot to mention which version of the plugin and jspdf they have used and with which version of tabulator |
Is your feature request related to a problem? Please describe.
Right now Tabulator is using jsPDF under the hood. jsPDF unfortunately does not support UTF-8 by default. There is ongoing issue opened on Github parallax/jsPDF#12
Describe the solution you'd like
Would be super cool if Tabulator can use something more "production" ready with all common features built in.
Describe alternatives you've considered
Maybe we can use pdfMake? https://github.com/bpampuch/pdfmake
Workaround
This is for users of Tabulator that are also struggling how to output special characters to your PDF exported by Tabulator. There is an option to add custom font to PDF with UTF-8 support.
Here is how you can do it:
Why is this workaround bad?
Providing font in binary is resulting, in my case, in loading unnecessary 277kb.
The text was updated successfully, but these errors were encountered: