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

中文乱码的问题可以这样解决 #27

Open
hawk140 opened this issue Jul 13, 2018 · 1 comment
Open

中文乱码的问题可以这样解决 #27

hawk140 opened this issue Jul 13, 2018 · 1 comment

Comments

@hawk140
Copy link

hawk140 commented Jul 13, 2018

return [
'components' => [
...
'response' => [
'formatters' => [
'pdf' => [
'class' => 'robregonm\pdf\PdfResponseFormatter',
_

_'mode' => 'zh-CN', // 这里是需要修改的部分。

__
'format' => 'A4', // Optional but recommended. http://mpdf1.com/manual/index.php?tid=184
'defaultFontSize' => 0, // Optional
'defaultFont' => '', // Optional
'marginLeft' => 15, // Optional
'marginRight' => 15, // Optional
'marginTop' => 16, // Optional
'marginBottom' => 16, // Optional
'marginHeader' => 9, // Optional
'marginFooter' => 9, // Optional
'orientation' => 'Landscape', // optional. This value will be ignored if format is a string value.
'options' => [
// mPDF Variables
// 'fontdata' => [
// ... some fonts. http://mpdf1.com/manual/index.php?tid=454
// ]
]
],
]
],
...
],
];

@wo13182421766
Copy link

没有用啊
'response' => [ 'formatters' => [ 'pdf' => [ 'class' => 'robregonm\pdf\PdfResponseFormatter', 'mode' => 'zh-CN', // Optional 'format' => 'A4', // Optional but recommended. http://mpdf1.com/manual/index.php?tid=184 'defaultFontSize' => 0, // Optional 'defaultFont' => '', // Optional 'marginLeft' => 15, // Optional 'marginRight' => 15, // Optional 'marginTop' => 16, // Optional 'marginBottom' => 16, // Optional 'marginHeader' => 9, // Optional 'marginFooter' => 9, // Optional 'orientation' => 'Landscape', // optional. This value will be ignored if format is a string value. ], ] ],

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