0

i'm using kartik gridview for export to pdf, and i need help to resolve this problem.

When I export to pdf yii2 return: "PHP Fatal Error"

"Class 'mPDF' not found"

public function setApi()
{
    $this->_mpdf = new mPDF(
        $this->mode,
        $this->format,
        $this->defaultFontSize,
        $this->defaultFont,
        $this->marginLeft,
        $this->marginRight,
        $this->marginTop,
        $this->marginBottom,
        $this->marginHeader,

Gridview options:

'exportConfig' => [
            GridView::PDF => [
                'config' => [
                    'contentBefore' => '<b> XXX - YYYY </b>',
                    'contentAfter'  => '<a href="#">Test</a>',
                ],
            ],

Installed components: vendor/mpdf/mpdf and vendor/kartik-v/yii2-mpdf.

Could someone help me solve this? Sorry for my English.

Erick Moraes
  • 41
  • 1
  • 4

1 Answers1

0

kartik-v/yii2-mpdf requires mpdf/mpdf try composer require mpdf/mpdf "*" after or before installing kartik-v/yii2-mpdf

rüff0
  • 906
  • 1
  • 12
  • 26