Yii2Assets / yii2-pdfjs

Yii2 PDFJS bundle of PDF.js plugin
https://yii2assets.github.io/yii2-pdfjs
22 stars 18 forks source link

Trying to get property 'buttons' of non-object #22

Open asudally opened 4 years ago

asudally commented 4 years ago

Trying to get property 'buttons' of non-object

$url = Url::toRoute([
    '/file/file/download',
    'id' => $model->id
]);
 echo \yii2assets\pdfjs\PdfJs::widget([
                'url' => $url,
                'width' => '100%',
                // 'height' => '100%',
                'buttons' => [
                    'presentationMode' => false,
                    'openFile' => false,
                    'print' => false,
                    'download' => true,
                    'viewBookmark' => false,
                    'secondaryToolbarToggle' => false
                ]
            ]);

Screenshot_2019-11-20_13-43-40

demirmehmet0 commented 3 years ago

hello, did you find a solution to the problem?

yamalweb commented 3 years ago

Put this into your common config

'modules' => [
        'pdfjs' => [
            'class' => '\yii2assets\pdfjs\Module',
            ]
        ],