forcePortraitHeaders
Special case - rotated Portrait headers on Landscape pages
In v2.3 this was updated to work for non-HTML headers/footers as well.
This is a quick fix which rotates HTML headers and Footers on landscape pages in the following conditions:
- document orientation is portrait
- when adding a page, you must only call
$mpdf->AddPage('L')
or<pagebreak orientation="landscape" />
if you try to set new margins/headers etc. for new landscape pages whenforcePortraitHeaders = true
, it will go wrong.
Default: false
Usage
Set at document initiation
<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf(['forcePortraitHeaders' => true]);
See also
- forcePortraitMargins - rotate only margins
- Headers & Footers