phpjasper-laravel icon indicating copy to clipboard operation
phpjasper-laravel copied to clipboard

PDF can't show chinese

Open acer22969 opened this issue 6 years ago • 4 comments

Hello~ When I use process() to export pdf,I can't show chinese in my pdf file. Is there exist any way to setting export language or i have to include chinese font name? Thanks u~

acer22969 avatar Aug 02 '18 15:08 acer22969

Hello @acer22969 Please check supported locales: http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html and then configure this way:

$options = [
    'format' => ['pdf'],
    'locale' => 'zh-CN',
    'params' => [],
    'db_connection' => [
        'driver' => 'postgres', //mysql, ....
        'username' => 'DB_USERNAME',
        'password' => 'DB_PASSWORD',
        'host' => 'DB_HOST',
        'database' => 'DB_DATABASE',
        'port' => '5432'
    ]
];

geekcom avatar Aug 02 '18 17:08 geekcom

Thank for you answer But I will get a error like : Undefined offset: 0 If I set 'locale' => '' to 'locale' => 'zh-TW' image image

acer22969 avatar Aug 03 '18 01:08 acer22969

I fix the last question But I got new error like: image

acer22969 avatar Aug 06 '18 17:08 acer22969

I fix the problem too. It's must be 'locale' => 'zh_TW' not 'locale' => 'zh-TW' But even I doesn't get any error,I still can't show chinese in my pdf file.QQ

acer22969 avatar Aug 07 '18 17:08 acer22969