Closed thiago-you closed 5 years ago
Mpdf have a lot of extra attributes. So its better to create an adapter that extends the yii2-mpdf and implement the required new features/properties.
You can achieve this without adding new properties for every mpdf setup this way as shown below (for your water marker):
use kartik\mpdf\Pdf;
$pdf = new Pdf([
'methods' => [
'SetWatermarkText' => '<your watermark text>',
],
'options' => [
'showWatermarkText' => true,
]
]);
// then wherever you need to render
echo $pdf->render();
Thanks Kartik. I had not seen the "methods" in the documents.
Scope
This pull request includes a
Changes
The following changes were made: