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 150 forks source link

marginHeader not working #61

Closed shabaz-ejaz closed 7 years ago

shabaz-ejaz commented 7 years ago

marginHeader doesn't do anything, I still have a top header margin in my PDF. Here is my code:

$pdf = new Pdf([
            'mode' => Pdf::MODE_BLANK,
            'filename' => 'report_' . date('d-m-Y_his') . '.pdf',
            'format' => Pdf::FORMAT_A4,
            'marginTop' => '0mm',
            'marginHeader' => '0mm',
            'orientation' => Pdf::ORIENT_PORTRAIT,
            'destination' => Pdf::DEST_FILE,
            'content' => $content,
            'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.css',
            'cssInline' => '.table{display:none} .header{background: #3f7398; height: 50px; width: 100%;}',
            'options' => ['title' => 'Epitomise Report'],
            'methods' => [
                'SetHeader'=>['<div class="header"></div>'],
                'SetFooter'=>['{PAGENO}'],
            ]
        ]);

        // return the pdf output as per the destination setting
         $pdf->render();

See screenshot: http://imgur.com/a/y5wVD

kartik-v commented 7 years ago

Get the updated build. This is resolved via #60.

shabaz-ejaz commented 7 years ago

Sorted after composer update. Thanks for your prompt reply.