jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

Utf8 support

Open shkuropat opened this issue 14 years ago • 166 comments

Is it posible to use non-latin (e.g. cyrillin) characters?

shkuropat avatar Apr 11 '12 15:04 shkuropat

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.

dvdotsenko avatar Jun 20 '12 17:06 dvdotsenko

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.

dvdotsenko avatar Dec 03 '12 17:12 dvdotsenko

Ok. It would be good to have support for UTF-8. I'll have to find some alternative. Thanks!

sguzgon avatar Dec 03 '12 17:12 sguzgon

Dear Dvdotsenko : How about the UTF8 support now? I also failed to show Chinese with jspdf . Jspdf is such a good tool , it's so pity. So could u give me some suggestions how to solve this issue?

Thanks in advance jessie

bluebluesky avatar Mar 12 '13 01:03 bluebluesky

any news about Unicode support? jsPDF is really fantastic tool but without Unicode support it's extremely limited...

zeligmanos avatar Jun 04 '13 10:06 zeligmanos

@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?

Mulegoat avatar Aug 27 '13 06:08 Mulegoat

What about Cp1250 ? Is there any chance to support?

kingdom91 avatar Sep 11 '13 10:09 kingdom91

Unfortunately can not use for production without UTF-8 support

deedarb avatar Mar 05 '14 04:03 deedarb

When it could be supported ? . utf-8 support is needed desperately.

prakash-murugesan-1835 avatar Mar 05 '14 05:03 prakash-murugesan-1835

I was so sure about utf-8 support...I didn't check and I started using the library. Damn.

albinotonnina avatar Mar 10 '14 13:03 albinotonnina

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?

defel avatar Mar 10 '14 17:03 defel

There's a fair few characters that appear to work. Full unicode support isn't in there though. It's something that we're working on. ᐧ

On Mon, Mar 10, 2014 at 5:47 PM, defel [email protected] wrote:

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?

— Reply to this email directly or view it on GitHubhttps://github.com/MrRio/jsPDF/issues/12#issuecomment-37211898 .

James Hall Director

Parallax

+44 113 322 6477 http://parall.ax/

Registered office: The Old Brewery, High Court, Leeds, LS2 7ES Registered in England no. 07430032 VAT No. 101 3405 84

MrRio avatar Mar 10 '14 17:03 MrRio

Ok, I forgot to include the file jspdf.plugin.standard_fonts_metrics.js .. everything works again as in my prototype

defel avatar Mar 10 '14 17:03 defel

@defel Can you post a code snippet how do you create documents with utf-8 support?

legikaloz avatar Mar 19 '14 14:03 legikaloz

@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žýáíé")

luciash avatar Apr 18 '14 03:04 luciash

@luciash as @MrRio wrote, there is no thing like UTF-8 support in jsPDF. But some basic unicode characters work, like ü or ².

defel avatar Apr 22 '14 07:04 defel

Ok, so no UTF-8 support, but please mention this on the jsPDF site, so we don't waste our time developing on something that is not going to work!

dave-watts avatar Jul 17 '14 10:07 dave-watts

Hey guys ... so as a result of the discussion above ... is there any chance that this will be implemented somehow and when could this happen?

D3CK3R avatar Jul 17 '14 14:07 D3CK3R

I think one can safely assume this is never going to happen, and finding an alternative library is the best course of action. The maintainers clearly simply don't care about it (which is usually an indication the project is no longer used by those maintaining it, and it's time to fork it if you do need to use it, and need its functionality extended)[

Pomax avatar Jul 30 '14 17:07 Pomax

@Pomax do it, fork it, implement UTF-8 support - everyone here would be happy to see this feature .. maybe you can also submit a pull-request then?

defel avatar Jul 30 '14 19:07 defel