Совместное использование FPDF и html2pdf для печати нижнего колонтитула и текста html - PullRequest
0 голосов
/ 30 марта 2020

Я пытаюсь напечатать верхний и нижний колонтитулы и текст HTML, используя FDPF и html2pdf. Это код, который я использую. Он печатает только часть HTML, игнорируя верхний и нижний колонтитулы, а также игнорируя красный цвет подчеркивания, печатая все черным цветом. Как я могу заставить все это работать одновременно?

<?php
require('fpdf/fpdf.php');
require __DIR__.'/vendor/autoload.php';

use Spipu\Html2Pdf\Html2Pdf;



class PDF extends FPDF
{
// Page header
function Header()
{
    // Logo
    $this->Image('logo.jpg',10,6,30);
    $this->Line(10,20,200,20);
    // Arial bold 15
    $this->SetFont('Arial','B',15);
    // Move to the right
    $this->Cell(80);
    // Title
    $this->Cell(30,10,'Report',0,0,'C');
    // Line break
    $this->Ln(20);
}

// Page footer
function Footer()
{
    // Position at 1.5 cm from bottom
    $this->SetY(-15);
    $this->Line(10,280,200,280);
    // Arial italic 8
    $this->SetFont('Arial','I',8);
    // Page number
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}


// Instanciation of inherited class

$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
$pdf = new Html2Pdf();
$pdf->writeHTML("<h4>LSPGSC<u style='text-decoration: underline red;'>RAS</u></h4>");
$pdf->Output();

?>
...