Closed Xoduz closed 5 years ago
Probably a browser caching issue. Worked around this by intercepting the button click with a javascript on click-event and adding a timestamp parameter to the url.
Hi!
Try to put this lines before rendering your PDF to the browser:
Yii::$app->response->format` = \yii\web\Response::FORMAT_RAW;
Yii::$app->response->headers->add('Content-Type', 'application/pdf');
:)
There seems to be a cache-related problem (tested in
Chrome 48, Opera 35 and IE 11) when using mpdf with destination DEST_BROWSER. The PDF file that opens in the browser doesn't get re-generated from the current view, but shows the previous PDF that was generated for the view - until I manually hit refresh in the browser tab that contains said PDF. This does not happen when destination is DEST_DOWNLOAD, it always reflects the current state of the view in question.Here's my setup:
Relevant Yii2 packages: mPDF 6.0 (20/12/2014) yii2-mpdf 1.0.0
View:
Projects Controller: