tkalactomo / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

printing PDF having font with the encoding UniGB-UCS2-H #163

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
just cannot recognize the character (Chinese) with encoding UniGB-UCS2-H
I know the problem is caused by the PDFRENDER.It cannot recognize the UniGB

What version of the product are you using? On what operating system?
1.5.6  win7

Please provide any additional information below.

Original issue reported on code.google.com by higgser2...@gmail.com on 13 Oct 2013 at 3:43

Attachments:

GoogleCodeExporter commented 9 years ago
I would recommend submitting this request to the pdf-renderer project.  If you 
can provide instructions for bundling 3rd party fonts, I'd happily make you a 
specialized build.

Original comment by tres.fin...@gmail.com on 13 Oct 2013 at 3:47

GoogleCodeExporter commented 9 years ago
Thank you very much !
I am using TCPDF to generate PDF documents.
And for Chinese character I use the font named stsongstdlight.
the font files can be found in tcpdf/fonts
the attachment is the stsongstdlight font file I found in tcpdf/fonts 

TCPDF: Open Source PHP Class for generating PDF documents.
http://www.tcpdf.org/

Original comment by higgser2...@gmail.com on 13 Oct 2013 at 4:45

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello Tres

I make a test.
----------------------
I generate two pdf documents,one is generated by TCPDF, and the other is 
generated by PDF-XChange 3.0. Both of them contain some characters using simhei 
font and some characters using times font.

see the attachments tcpdf.pdf and pdf-xchange.pdf

When I print them using jZebra(Chrome ,win7), the result is: 
1. Characters using simhei font in tcpdf.pdf cannot be recognized, but the 
characters in pdf-xchange.pdf can be recognized
2. Characters using times font in both documents can be recognized

So what is the problem? 

---------------------

I am using jZebra to print receipts. 
I have tried the way using html , but the printer stops during the printing, 
and I have no ideas about that.
And I have tried the way using html2canvas, but the image quality is low.
So I tried the way using PDF and get this issue.

Original comment by higgser2...@gmail.com on 13 Oct 2013 at 7:28

Attachments:

GoogleCodeExporter commented 9 years ago
I am not a PDF expert but from my undersyanding, some PDF generators embed 
fonts directly into the PDF.  This makes the PDF much larger but provides 
greater compatibility with PDF readers.

Does TCPDF have an option that allows automatically font embedding?

I do not know how PDF render packages these fonts, but I can add it to the 
build script if it fixes your issue (I just need help knowing how to do that).

-Tres

Original comment by tres.fin...@gmail.com on 13 Oct 2013 at 2:29

GoogleCodeExporter commented 9 years ago
Hello Tres

TCPDF doesn't seem to hava the option to embed fonts.Some fonts are embeded  
automatically, but some other are not.

Though some Chinese fonts are embeded, they use multibyte encodings like 
GB-EUC-H,GBK-EUC-H. And pdf-renderer does not support the encodings.

pdf-renderer hasn't updated in a long time. 
I know there is an open source java pdf library called PDFBOX. And it support 
many fonts, including Chinese fonts.
I suggest that jZebra use pdfbox instead of pdf-renderer. And I think that will 
make jZebra more widely used.

Thank you for the replying and the great work of jZebra

-William

Original comment by higgser2...@gmail.com on 15 Oct 2013 at 9:04

GoogleCodeExporter commented 9 years ago
Thanks for the link.

I'll look into PDFBOX soon.  I would be happy to switch the PDF Rendering 
engine to one that is more feature complete.

Original comment by tres.fin...@gmail.com on 15 Oct 2013 at 12:23