Background color missing on last page when using tocpagebreak

Aberta
#2,159 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 5 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
22/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
css, php
Domínio
backend

Direção de pesquisa

The payload names no source files, so start by running the snippet with Mpdf\Mpdf and checking the last page's background. Then remove tocpagebreak and the TOC entries to see whether a plain pagebreak reproduces it. Done means the red div background renders on every page, including the last one, with a regression test added to the suite.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Guidelines
Description of the bug

I'm generating a PDF where a background-color is applied to the <body>, a TOC is created using tocpagebreak, and a colored <div> is added to each page. On the last page, the background color of <div> is missing. The previous pages work fine.

mPDF version

8.2.8

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

PHP 8.3, Apache

Reproducible PHP+CSS+HTML snippet suffering by the error
$html = "
<!DOCTYPE html>
<html>
    <body style='background-color: gray;'>
		<tocpagebreak>
		<tocentry content='Test1'>
		<div style='background-color: red;'>Test1</div>
		<pagebreak>
		<tocentry content='Test2'>
		<div style='background-color: red;'>Test2</div>
		<pagebreak>
		<tocentry content='Test3'>
		<div style='background-color: red;'>Test3</div>
    </body>
</html>";

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($html);
$mpdf->Output();
Linguagem predominante
PHP
Estrelas
4.7k
Forks
1.1k
Merge médio
6d 11h
PRs com merge (30d)
4

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de mpdf/mpdf

Todas as issues de mpdf/mpdf

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.