-
Notifications
You must be signed in to change notification settings - Fork 65
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
How to use on pdf #11
Comments
You will have to use a library to add the resulting image into your pdf document. Something like https://github.com/mpdf/mpdf |
I have the same issue. I'm using Kartik-v's mpdf extension for Yii2 and your QR-Code extension. The issue I run into is the following: public function actionQrcode($text){
Yii::$app->response->format = Response::FORMAT_RAW;
Yii::$app->response->headers->set('Content-Type','image/png');
return QrCode::png($text)
} The Controller renders the view in the public function actionPdf($id) {
$model = $this->findModel($id);
#return $this->renderPartial('_pdf', ['model' => $model]);
$content = $this->renderPartial('_pdf', ['model' => $model]);
$pdf = new Pdf([
'content' => $content,
'filename' => 'Ticket_' . $model->id . '.pdf',
'options' => [
'title' => 'Your ticket as '
],
'cssFile' => '@webroot/css/pdf.css'
]);
$pdf->render();
} In the PDF the QR code is displayed as "missing image" icon, if I uncomment the third line ( |
No description provided.
The text was updated successfully, but these errors were encountered: