kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 151 forks source link

A non-numeric value encountered #82

Closed winkersco closed 5 years ago

winkersco commented 5 years ago

Prerequisites

Steps to reproduce the issue

  1. I write this code in controller:

public function actionTest($id) { $model = $this->findModel($id); $content = $this->renderPartial('view', [ 'model' => $model, ]); $pdf = new Pdf([ 'mode' => Pdf::MODE_UTF8, 'content' => $content, ]); return $pdf->render(); }


2. and then send request to this action.

## Expected behavior and actual behavior

When I follow those steps, I see that a `yii\base\ErrorException` occurs.

![image](https://user-images.githubusercontent.com/24722498/43601022-765a8582-96a1-11e8-9c8d-a925ebc12139.png)

I was expecting to render a PDF from view.

## Environment

Apache/2.4.26 (Unix) OpenSSL/1.0.2l PHP/7.1.7 mod_perl/2.0.8-dev Perl/v5.16.3
Yii Framework/2.0.15.1

#### Browsers

- [x] Google Chrome
- [x] Mozilla Firefox
- [] Internet Explorer
- [] Safari

#### Operating System

- [x] Windows
- [ ] Mac OS X
- [x] Linux
- [ ] Mobile

#### Libraries

- jQuery version:
- yii2-mpdf version:

## Isolating the problem

- [ ] This bug happens [on the demos page](https://demos.krajee.com/mpdf)
- [ ] The bug happens consistently across all tested browsers
- [ ] This bug happens when using yii2-mpdf without other plugins.
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ricar2ce commented 5 months ago

Hello @winkersco , greetings, did you find the solution for this problem? I am in the same situation