Master:
# 1    great to use tcpdf for Chinese text
exp
Online no
State
Grouping SuperMaster
Class class6
Score 1593
Wealth 10098
Posts 951
Login 09:24:49
dompdf is not working for Chinese text, so i tried tcpdf.
I use stsongstdlight as font, so it works

$pdf->SetFont('stsongstdlight', '', 12);
Hits: 1258, Date: 2013-11-01 09:13:46
[Agree] ( 0 ) [Against] ( 0 )

# 2    There are some other encoding problems
exp
Online no
State
Grouping SuperMaster
Class class6
Score 1593
Wealth 10098
Posts 951
Login 09:24:49
You in Chinese website, someone text is gb2312, and some could be big5, this could cause crash when they are transferred to utf-8, so you may need to change all to gb2312, then change to utf-8. The following codes work for this:

$html = iconv("gb2312","gb2312//IGNORE",$html);
$html = iconv("gb2312","utf-8//IGNORE",$html);

I use //IGNORE to prevent crash.

Using tcpdf, we can convert the html content to pdf file.
Hits: 1257, Date: 2013-11-01 09:18:04
[Agree] ( 0 ) [Against] ( 0 )

# 3    tcpdf also support separated css style for html page
exp
Online no
State
Grouping SuperMaster
Class class6
Score 1593
Wealth 10098
Posts 951
Login 09:24:49
tcpdf also support separated css style for html page
Hits: 1255, Date: 2013-11-01 09:18:40
[Agree] ( 0 ) [Against] ( 0 )

# 4    i ofen get headache for encording problem
dave2
Online no
State
Grouping Seller
Class class2
Score 26
Wealth 167.5
Posts 37
Login 15:32:41
 
i ofen get headache for encording problem
Hits: 1250, Date: 2013-11-03 09:09:00
[Agree] ( 0 ) [Against] ( 0 )

# 5    you may need to set more memory and time for tcpdf
luke
Online no
State 453
Grouping Super Admin
Class class8
Score 3327
Wealth 289
Posts 1673
Login 09:44:27
 
ini_set to set these:
ini_set('max_execution_time',120);
ini_set('memory_limit','1200M');
Hits: 1247, Date: 2013-11-04 13:43:13
good man
[Agree] ( 0 ) [Against] ( 0 )

1 - 5 [ 5]
Reply: great to use tcpdf for Chinese text
*First line:
More content:
Tags:

Hint: You cannot post here before facebook | Log in | Sign up

Before you post...

The forum is for discussion of web and software development related issues including design help, web scripting and development techniques. In addition to the Forum Rules, there are a few topics which are not permitted here.

Inappropriate Topics

Threads on the following topics are not permitted and will be removed:
  • Soliciting for developers to work on projects (paid or unpaid)
  • Requesting estimates for website design
  • Website design reviews