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

yii2-pdf is not compatible with mpdf v7+ #28

Open
zoran-grujic opened this issue Jun 7, 2019 · 1 comment
Open

yii2-pdf is not compatible with mpdf v7+ #28

zoran-grujic opened this issue Jun 7, 2019 · 1 comment

Comments

@zoran-grujic
Copy link

I wanted to use PHP 7+ and I stumbled into a problem. It is required to use mpdf v7 with PHP 7+ and yii2-pdf does not support mpdf v7+. Is there will to update the yii2-pdf? It seems like the change is rather trivial according to:
https://harrybailey.com/2018/08/yii-1-php-7-1-yii-pdf-and-mpdf/

@zoran-grujic
Copy link
Author

Just to confirm, I managed to make it work with mpdf v7.1.9. It was required to change single line in PdfResponseFormatter.php:

protected function formatPdf($response)
{
$mpdf = new \Mpdf\Mpdf([$this->mode,
$this->format,
$this->defaultFontSize,
$this->defaultFont,
$this->marginLeft,
$this->marginRight,
$this->marginTop,
$this->marginBottom,
$this->marginHeader,
$this->marginFooter,
$this->orientation
]);

NOTE:
class name: \Mpdf\Mpdf
constructor accepts array: [$this->mode, $this->format, ... ], there are '[' and ']' around parameter list.

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

1 participant