Skip to content
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

PDF can't show chinese #12

Open
acer22969 opened this issue Aug 2, 2018 · 4 comments
Open

PDF can't show chinese #12

acer22969 opened this issue Aug 2, 2018 · 4 comments

Comments

@acer22969
Copy link

acer22969 commented Aug 2, 2018

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~

@geekcom
Copy link
Member

geekcom commented Aug 2, 2018

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'
    ]
];

@acer22969
Copy link
Author

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
Copy link
Author

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

@acer22969
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants