Footer doesn't show on long and multiple pages

Đang mở
#1,860 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
backend

Hướng nghiên cứu

Start by reproducing the report with the snippet in the issue: a writeHTML body long enough to span several pages, with SetHTMLFooter set before each AddPage chapter. Check which pages after the first in each chapter lose the footer, and whether the {PAGENO} reset is involved. Done means every page of a multi-page chapter shows its footer with the correct page number, with a test covering the case. The last comment is about 743 days old and no pull request is linked, so ask the maintainers whether the behavior is still open before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

missing sample / test
Guidelines
Description of the bug

I'm trying to write a story which consists of different chapters into a pdf file.

My codes generate a PDF file with the following page footers:

Page 1 on file: [no footer] (it's the Table of Contents)
Page 2 on file: Chapter 1 Page 1 (because I reset the page number here)
Page 3 on file: [no footer]
Page 4 on file: [no footer]
Page 5 on file: Chapter 2 Page 4
Page 6 on file: [no footer]
Page 7 on file: [no footer]
Page 8 on file: [no footer]
Page 9 on file: Chapter 3 Page 8
Page 10 on file: [no footer]
Page 11 on file: [no footer] ....

I believe this is a bug that the pages in between have no footers. Or is my implementation flawed? Please advice.

mPDF version

8.0.13

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

7.4, php-fpm on centos

Reproducible PHP+CSS+HTML snippet suffering by the error
$mpdf = new \Mpdf\Mpdf();
$mpdf->writeHTML('<h3>Table of Contents</h3>'.$TOC_list, 2);

foreach ($chapters as $i => $chapter) {
    $mpdf->AddPage('', '', ($i == 0 ? '1' : ''));
    $mpdf->SetHTMLFooter('<table width="100%">
    <tr>
        <td width="70%">'.$chapter->title.'</td>
        <td width="30%" align="right">Page {PAGENO}</td>
    </tr>
</table>', 'O');

    $mpdf->writeHTML($chapter->body, 2); // please note that the body can be multiple pages long
}
$mpdf->Output();
Ngôn ngữ chính
PHP
Star
4.7k
Fork
1.1k
Merge trung bình
6 ngày 11 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mpdf/mpdf

Tất cả issue của mpdf/mpdf

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.