-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Utf8 support #12
Comments
As of June 2012 jsPDF still does not support the version of Unicode (UCS-2 BE / UTF16 BE) PDF format allows. This means, that almost all characters outside of ASCII are pretty much broken. There are plans to add support for UCS-2 streams to jsPDF, maybe somewhere over this summer - 2012. It's a lot of work. |
Nowhere at this time. It's still too much work. Unicode will not be here until code is added to support embedding (and subsetting) unicode fonts within PDF. That alone is a gargantuan task and a logistics issue since it involves pulling binary blobs into browser and it inflates the size of PDF. Unless someone with a skill really needs this, or some party is willing to sponsor this move, it's unlikely to happen naturally. |
Ok. It would be good to have support for UTF-8. I'll have to find some alternative. Thanks! |
Dear Dvdotsenko : Thanks in advance |
any news about Unicode support? jsPDF is really fantastic tool but without Unicode support it's extremely limited... |
@dvdotsenko when you say 'almost' all characters, would that include UL list items like a disc? This seems like the most basic character requirement which i cannot get with ASCII encoding. All bullets get stripped out of the PDF when using the fronHtml method. Is there any kind of work around to include this character? |
What about Cp1250 ? Is there any chance to support? |
Unfortunately can not use for production without UTF-8 support |
When it could be supported ? . utf-8 support is needed desperately. |
I was so sure about utf-8 support...I didn't check and I started using the library. Damn. |
strange, had utf-8 support on my prototype, but its gone as soon I use it on production .. Is there are any plugin or lib I forgot to include? |
There's a fair few characters that appear to work. Full unicode support On Mon, Mar 10, 2014 at 5:47 PM, defel notifications@github.com wrote:
James Hall Parallax +44 113 322 6477 Registered office: The Old Brewery, High Court, Leeds, LS2 7ES |
Ok, I forgot to include the file |
@defel Can you post a code snippet how do you create documents with utf-8 support? |
@defel I wonder how you made UTF-8 working by including jspdf.plugin.standard_fonts_metrics.js too. It does not work for me with "ěščřžýáíé". (result is the same as without that plugin: "šYžýáíé") |
It is too complicated to put in the readme that it doesn't accept utf-8 yet? The idea is to help the other devs, right? |
@arasabbasi if you want, share with us your progress, and let's know if we can help to make this evil see the light. At the end, the idea of open source is to let other contribute. |
@asalhani @eddieklc Best Regards |
We will be very grateful if you could release fix with UTF-8 support <3 :) Also I suggest that you should create profile on Open Collectives or Patreon to get some funds cause this library / package is pretty dope. It helps a lot and I think you deserve to get some money for that! |
Hello @pawel-miczka It has nothing to do with getting paid. We are all here softwaredevelopers doing this in our free time. And we have a social life and are all busy. And when I get called a liar for something which is not in my powers, than I think that some people expect us to be their slaves, or what? |
Now shipping in 1.4.0 🎉 |
Will you update documentation on how to set this up or could you send here some example because now I'm using 1.4.0 and I still don't have polish letters? Thanks anyway for update 👍 |
If you want to use polish letters and if they are not part of ASCII you have to add a font which contains the polish letters- Go To /examples/basic.html and check out the last tab "Using Fonts" |
How do I add ℃ to my pdf ? I have tried to search for an example, but nothing was found. Thks for your effort to develop this library !!!! |
@arasabbasi to add a font that contains (some utf-8) letters, can you point to what is the proper way to add it ? it is not clear in the document if I should use addFont or setFont , thanks I am trying to add fonts that support Arabic (like sans-serif for example) |
@arasabbasi how You get the variable - PTSans value from examples/basic.html ? |
is there any way to do a fallback font? the data I need to render in a generated pdf is dynamic, so some could be in spanish, some in japanese, etc. |
full base64 encoded ttffile is too big..... |
Day 2000... still no fix 😆 |
Yeah, so what? I added a font converter. I wrote last week a HTML-plugin which is custom fonts compatible and all that stuff last week. I rework right now the documentation generation. You can see under projects the jsPDF 1.4.2 issues which have to be solved till then and what I fixed till now. https://github.com/MrRio/jsPDF/projects/4 Three big issues for jsPDF 1.4.2 Better ttfsupport, better Arabic support and an error in the text method. So yeah. If you want you can participate. Everybody is invited to provide some good code and please don't forget the unit tests. Then we will have 1.4.2 in no time |
Just my 2c, for those not afraid to go async. The base64 encoder is not mine, but can't find the original source anymore... This uses promises to download the font files and jspdf asynchronously, and set up everything in the browser. Note, this is a little awkward way to use it when pulled out of context, but the actual idea should be easy to adapt.
|
How to use font for hindi text using jspdf version 1.4.0 |
I've managed to produce PDFs with Hebrew. Used Arimo font (converted to Base64 online and stored as const in code) and of course added a reversing function of my own to support RTL. reverseHebrew(str) { Thanks @arasabbasi |
For some reason, UTF-8 support for |
fromHTML is deprecated and will not be getting any updates or support. We will have a new html 2 pdf method in the next release. |
@arasabbasi I used a custom font that contains polish letters but still got in the output the weird character þÿ . |
Hi Mr. Rio, I am not sure what is shipped in 1.4.0. Does this mean that the library is supporting UTF-8 from 1.4.0 onwards? Please clarify. |
Locking to reduce possible Spam. |
Is it posible to use non-latin (e.g. cyrillin) characters?
The text was updated successfully, but these errors were encountered: