Closed antman3351 closed 3 years ago
I think the problem is the 1st head is being write twice. If you open the document with LibreOffice Draw you can see the elements of the 1st header are double while the 2nd page header is correct.
I did some more digging.
So in my case the first "block" is a named page, on every new named mpdf adds a new page by calling AddPage()
that will add a new page unless it's the first page an is empty ( I think that's what the check if (!($pagesel && $this->page == 1 && (sprintf("%0.4f", $this->y) == sprintf("%0.4f", $this->tMargin)))) {
in _beginpage()
does.
So a new page may or may not be added, but AddPage()
adds $this->writer->write( '___HEADER___MARKER' . $this->uniqstr );
without checking, so in my case ___HEADER___MARKER' . $this->uniqstr
is added again.
I think
$this->writer->write( '___PAGE___START' . $this->uniqstr );
$this->writer->write( '___BACKGROUND___PATTERNS' . $this->uniqstr );
$this->writer->write( '___HEADER___MARKER' . $this->uniqstr );
should be moved into the _beginpage()
function inside the first if
or you can check that the $this->page has been incremented after calling _beginpage()
if it has to be written after the template import.
With that change the heads work for me. Is this fix ok?
Hello, I have a problem with the first header of a named page. Mpdf doesn't apply font-weight style correctly.
In the attached image you can see how the 1st page is bolder (it's not quite a bold, but not normal)
Thanks!