Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php TCPDF中未显示的标题_Php_Header_Tcpdf - Fatal编程技术网

Php TCPDF中未显示的标题

Php TCPDF中未显示的标题,php,header,tcpdf,Php,Header,Tcpdf,我想用TCPDF在PDF页面上设置页眉和页脚 在@Simone Rossaini的帮助下,我尝试这样做: <?php require_once('C:\Users\Administrateur\Desktop\testjelix\vendor\tecnickcom\tcpdf\examples\tcpdf_include.php'); // create new PDF document $pdf = new TCPDF; class FDR extends TCPDF {

我想用TCPDF在PDF页面上设置页眉和页脚

在@Simone Rossaini的帮助下,我尝试这样做:

    <?php
require_once('C:\Users\Administrateur\Desktop\testjelix\vendor\tecnickcom\tcpdf\examples\tcpdf_include.php');

// create new PDF document
$pdf = new TCPDF;
class FDR extends TCPDF {

    //Page header
    public function Header() {        
        // Set font
        $this->SetFont('helvetica', 'B', 35);
        // Title
        //Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
        $this->Cell(0, 0, 'Feuille de route', 0, false, 'C', 0, '', 0, false, 'M', 'M');
    }

    // Page footer
    public function Footer() {
        // Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont('helvetica', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
        //date time
        $tDate = date("F j, Y, g:i a");
        $this->Cell(0, 10, 'Document généré par Wee.org le '.$tDate, 0, false, 'R', 0, '', 0, false, 'T', 'M');      
    }
}

// create new PDF document
$pdf = new FDR(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDFCREATOR);
$pdf->SetAuthor('Wee');
$pdf->SetTitle('Feuille de route');
$pdf->SetSubject('GBiuac');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set font
$pdf->SetFont('helvetica', '', 11);

// add a page
$pdf->AddPage('L', 'A4');

//Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
$pdf->Image('C:\Users\Administrateur\Desktop\testjelix\gp-logo.jpg', '', '', "", 35, '', '', 'T', false, 300, 'L', false, false, 1, false, false, false); 
$pdf->Ln(40);
//Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
$pdf->Cell(0, 0, 'COVID 19', 1, 1, 'C', 0, '', 1);
//MultiCell(w, h, txt, border = 0, align = 'J', fill = 0, ln = 1, x = '', y = '', reseth = true, stretch = 0, ishtml = false, autopadding = true, maxh = 0) ⇒ Object
$pdf->MultiCell(0, 2, 'En raison des mesures Covid, nous prenons toutes les mesures nécessaires pour la sécurité et la sérénité de nos invités et du public.Le port du masque est obligatoire pour tous vos rendez-vous - Les règles sanitaires à respecter seront indiquées à l\'entrée de chaque lieu du Festival. Un masque spécial vous sera donné à votre arrivée.', 0, '', 0, 1, '', '', true);
$pdf->Cell(0, 0, 'SOIREE', 1, 2, 'C', 0, '', 3);
$pdf->MultiCell(0, 2, 'Chaque soir, après votre séance, nous vous donnons RDV au Garage / Librairie des Bauges à partir de 22:00, 22:30 pour partager un moment autour d\'un verre (ou non). En toute sécurité et quiétude.', 0, '', 0, 1, '', '', true);
$pdf->Cell(0, 0, 'VOUS ET VOTRE CHARGE D\'ACCUEIL', 1, 1, 'C', 0, '', 3);

   $tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
    <tr>
        <td align="center" style="background-color:#FFFF00">Prénom</td>
        <td align="center" style="background-color:#FFFF00">Nom</td>        
        <td align="center" style="background-color:#FFFF00">Téléphone</td>
        <td align="center" >Chargé d'accueil</td>
        <td align="center" style="background-color:#D9E7FD">JS</td>
        <td align="center" style="background-color:#D9E7FD">ESNLT</td>
        <td align="center" style="background-color:#D9E7FD">06 70 80</td>
    </tr>
    <tr>
        <td align="center" colspan="4"></td>
        <td align="center" style="background-color:#D9E7FD">Max</td>
        <td align="center" style="background-color:#D9E7FD">JAZZAVILLE</td>
        <td align="center" style="background-color:#D9E7FD">59 78</td>
    </tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

$pdf->Cell(0, 0, 'TRANSPORTS', 1, 1, 'C', 0, '', 3);
 $tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
    <tr>
        <td align="center" colspan="6">Transport SNCF</td>
        <td align="center" colspan="2">Véhicule Personnel</td>
    </tr>
    <tr>
        <th align="center" rowspan="1">Lieu d'arrivée</th>
        <th align="center" style="background-color:#FFFF00">Chambéry</th>
        <th align="center">Date et horaire d'arrivée Train</th>
        <th align="center" style="background-color:#FFFF00">13:18</th>
        <th align="center">Horaire de RDV pour transfert</th>
        <th align="center" style="background-color:#FFFF00">13:20</th>
        <th align="center" rowspan="2">Lieu de RDV</th>
        <th align="center" rowspan="2">Salle de la Municipalité - Hôtel de Ville</th>
    </tr>
     <tr>
        <th align="center" rowspan="1">Lieu de départ</th>
        <th align="center" style="background-color:#FFFF00">Chambéry</th>
        <th align="center">Date et horaire départ Train</th>
        <th align="center" style="background-color:#FFFF00">10:22</th>
        <th align="center">Horaire de RDV pour transfert</th>
        <th align="center" style="background-color:#FFFF00">9:00</th>
    </tr>
    <tr>
        <th align="center" rowspan="2" colspan="2" >Contact Bureau Transport</th>
        <th align="center" colspan="2">M. Denis BOHAN</th>
        <th align="center" colspan="2">06 08 86  26 22</th>
        <th align="center" colspan="4"rowspan="2">Parking : Parking du Palais de Justice - 12 cours de l'Hôtel de Ville</th>
    </tr>
     <tr>
        <th align="center" colspan="2">M. François GIORS</th>
        <th align="center" colspan="2">06 27 15 18 31</th>
    </tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

$pdf->Cell(0, 0, 'HEBERGEMENT', 1, 1, 'C', 0, '', 3);
   $tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
     <tr>
        <th align="center" colspan="2">Lieu</th>
        <th align="center" colspan="6">Résidence 3*** Citadelle de Conflans - Place de Conflans 73200 ALBERTVILLE</th>
    </tr>
    <tr>
        <th align="center" colspan="2">Code porte</th>
        <th align="center" colspan="6">07200 - En cas de problèmes d'ouverture : 04 79 37 84 60</th>
    </tr>
     <tr>
        <th align="center" colspan="2" rowspan="2">Nuitée</th>
        <th align="center" colspan="1">jeudi 15 octobre</th>
        <th align="center" colspan="1">vendredi 16 octobre</th>
        <th align="center" colspan="1">samedi 17 octobre</th>
        <th align="center" colspan="1">dimanche 18 octobre</th>
        <th align="center" rowspan="3">CHAMBRE</th>
    </tr>
    <tr>
        <th align="center" style="background-color:#FFFF00"></th>
        <th align="center" style="background-color:#FFFF00"></th>
        <th align="center" style="background-color:#FFFF00"></th>
        <th align="center" style="background-color:#FFFF00">7</th>        
    </tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

// add a page
$pdf->AddPage('L', 'A4');
$pdf->Cell(0, 0, 'RESTAURATION CATERING', 1, 1, 'C', 0, '', 3);
 $tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
     <tr>
        <th align="center" colspan="2">Lieu</th>
        <th align="center" colspan="6">Salle René Cassin</th>
    </tr>
    <tr>
        <th align="center" colspan="2">Repas Menu</th>
        <th align="center" colspan="6">Cantine bio - Repas bio à dominante végétarienne</th>
    </tr>
     <tr>
        <th align="center">Horaires de service</th>
        <th align="center" colspan="2">Midi de 11:30 à 14:00</th>
        <th align="center" colspan="2">Soir de 18:30 à 21:30</th>
        <th align="center">Signaler un retard ou une demande</th>
        <th align="center">Mme Bernadette </th>
        <th align="center">06 61 20 10</th>
    </tr>
    <tr>
        <th align="center" colspan= "3">Régime alimentaire signalé par l'invité</th>
        <th align="center" colspan= "5"></th>
    </tr>
    <tr>
        <th align="center" rowspan = "2">Repas prévus</th>
        <th align="center">jeudi 15 soir</th>
        <th align="center">vendredi 16 midi</th>
        <th align="center">vendredi 16 soir</th>
        <th align="center">samedi 17 midi</th>
        <th align="center">samedi 17 soir</th>
        <th align="center">dimanche 18 midi</th>
        <th align="center">dimanche 18 soir</th>
    </tr>
    <tr>
        <th align="center" style="background-color:#FFFF00">0</th>
        <th align="center" style="background-color:#FFFF00">0</th>
        <th align="center" style="background-color:#FFFF00">0</th>
        <th align="center" style="background-color:#FFFF00">0</th>
        <th align="center" style="background-color:#FFFF00">0</th>
        <th align="center" style="background-color:#FFFF00">7</th>
        <th align="center"style="background-color:#FFFF00">GARAGE 7 + MAX</th>
    </tr>
    <tr align="center" colspan="8">Vous avez été informé par la présente feuille de route de la commande de vos repas. Nous vous remercions de la respecter afin d'éviter tout gaspillage, qui serait incohérent avec les valeurs que nous défendons. Si vous souhaitez ne pas bénéficier des repas et les prendre en dehors de l'organisation à votre charge, nous vous remercions d'informer M. Jean Sébastien ESNAULT 06 03 70 80
    </tr>
</table>
<br/>
<br/>
<br/>
<br/>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

$pdf->Cell(0, 0, 'VOTRE PLANNING', 1, 1, 'C', 0, '', 3);

$tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
     <tr>
        <th align="center" colspan="2">Date et heure</th>
        <th align="center" colspan="2">Vos rendez vous</th>
        <th align="center" colspan="1">Lieu</th>
        <th align="center" colspan="1">Heure RDV</th>
        <th align="center" colspan="1">Contact Animateur</th>
        <th align="center" colspan="1">Infos complémentaires</th>
    </tr>
    <tr>
        <th align="center" colspan="2">14:00</th>
        <th align="center" colspan="2">Catering + Raccord</th>
        <th align="center" colspan="1">René CASSIN</th>
        <th align="center" colspan="1">14:00</th>
        <th align="center" colspan="1">JS ESNAULT 06 70 80 </th>
        <th align="center" colspan="1"></th>
    </tr>
     <tr>
        <th align="center" colspan="2">15:00</th>
        <th align="center" colspan="2">Dépose Bagages Citadelle + Prise de clés</th>
        <th align="center" colspan="1">Citadelle</th>
        <th align="center" colspan="1">15:00</th>
        <th align="center" colspan="1">JS ESNAULT 06 03 00 70 80 </th>
        <th align="center" colspan="1"></th>
    </tr>
    <tr>
        <th align="center" colspan="2">15:30 > 17:15</th>
        <th align="center" colspan="2">Arrivée Dôme : montage, patch, balances</th>
        <th align="center" colspan="1">Dôme Théâtre</th>
        <th align="center" colspan="1">15:30</th>
        <th align="center" colspan="1">JS ESNAULT 06 03 70 80</th>
        <th align="center" colspan="1"></th>
    </tr>
    <tr>
        <th align="center" colspan="2">17:45 (+ ou - 10 minutes)</th>
        <th align="center" colspan="2">Concert / Fin 19:00 à 19:20</th>
        <th align="center" colspan="1">Dôme Théâtre</th>
        <th align="center" colspan="1"></th>
        <th align="center" colspan="1">JS ESNAULT 06 70 80</th>
        <th align="center" colspan="1"></th>
    </tr>
     <tr align="center">BILLETS EXONERES >Assister à des séances en dehors de vos interventions</tr>
     <br/>
     <tr align="center">Veuillez prendre contact avec votre chargé d'accueil à l'arrivée pour voir quelles séances peuvent être disponbiles et combinables avec votre planning et votre présence.</tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

$pdf->AddPage('L', 'A4');

$pdf->Cell(0, 0, 'VOS CONTACTS UTILES', 1, 1, 'C', 0, '', 3);
 $tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
     <tr>
        <th align="center">Votre chargé d'accueil</th>
        <th align="center">Chantal</th>
        <th align="center">BOA</th>
        <th align="center">06 37 87 1</th>
    </tr>
    <tr>
        <th align="center">Chargé d'accueil (au cas où le vôtre n'est pas disponible)</th>
        <th align="center">Jannick</th>
        <th align="center">LADY</th>
        <th align="center">06 11 57 39 90</th>
    </tr>
    <tr>
        <th align="center">Délégué Général  du Festival</th>
        <th align="center">Jean Sébastien</th>
        <th align="center">ESNT</th>
        <th align="center">06 03 80</th>
    </tr>
    <tr>
        <th align="center">Transports et navettes</th>
        <th align="center">Denis</th>
        <th align="center">Bon</th>
        <th align="center">06 26 22</th>
    </tr>
    <tr>
        <th align="center">Hébergement - Citadelle de Conflans</th>
        <th align="center"></th>
        <th align="center"></th>
        <th align="center">04 84 60</th>
    </tr>
    <tr>
        <th align="center">Restauration Catering</th>
        <th align="center">Bernadette</th>
        <th align="center">PAVILLIERS</th>
        <th align="center">06 61 10</th>
    </tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');

$pdf->Ln(6);


// example using general stretching and spacing


// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('FDR.pdf', 'I');

//============================================================+
// END OF FILE
//============================================================

您可以扩展类,但不使用它

您需要对其进行扩展,然后使用您选择的新名称,如:

require_once('C:\Users\Administrateur\testjelix\vendor\tecnickcom\tcpdf\examples\tcpdf_include.php');
class FdrPdf extends TCPDF {

    private $invoice_footer;

    //Page header
    public function Header() {
        // Logo
        $image_file = K_PATH_IMAGES . 'C:\Users\Administrateur\testjelix\gp-logo.jpg';
        $this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
        // Set font
        $this->SetFont('helvetica', 'B', 35);
        // Title
        $this->Cell(0, 15, 'Feuille de route', 0, false, 'C', 0, '', 0, false, 'M', 'M');
    }

    // Page footer
    public function Footer() {
        // Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont('helvetica', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
        $this->invoice_footer = 'Document généré le ' . $dtnow->toString(jDateTime::LANG_DFORMAT) . ' à ' . substr($dtnow->toString(jDateTime::LANG_TFORMAT), 0, -3) . ' via me.org - www.me.org';
    }

}

// create new PDF document
$pdf = new FdrPdf;
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Me');
$pdf->SetTitle('Feuille de route');
$pdf->SetSubject('GB');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 35);
// add a page
$pdf->AddPage('L', 'A4');
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
$pdf->Ln(40);
$pdf->SetFont('helvetica', '', 11);
//Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
$pdf->Cell(0, 0, 'COVID 19', 1, 1, 'C', 0, '', 1);
$pdf->MultiCell(0, 2, 'En raison des mesures Covid, nous prenons toutes les mesures nécessaires pour la sécurité et la sérénité de nos invités et du public.Le port du masque est obligatoire pour tous vos rendez-vous - Les règles sanitaires à respecter seront indiquées à l\'entrée de chaque lieu du Festival. Un masque spécial vous sera donné à votre arrivée.', 0, '', 0, 1, '', '', true);
$pdf->Cell(0, 0, 'SOIREE', 1, 2, 'C', 0, '', 3);
$pdf->MultiCell(0, 2, 'Chaque soir, après votre séance, nous vous donnons RDV au Garage / Librairie des Bauges à partir de 22:00, 22:30 pour partager un moment autour d\'un verre (ou non). En toute sécurité et quiétude.', 0, '', 0, 1, '', '', true);

$pdf->Cell(0, 0, 'VOUS ET VOTRE CHARGE D\'ACCUEIL', 1, 1, 'C', 0, '', 3);

$tbl = <<<EOD
<table cellspacing="0" cellpadding="1" border="1">
    <tr>
        <td align="center" style="background-color:#FFFF00">Prénom</td>
        <td align="center" style="background-color:#FFFF00">Nom</td>        
        <td align="center" style="background-color:#FFFF00">Téléphone</td>
        <td align="center" >Chargé d'accueil</td>
        <td align="center" style="background-color:#D9E7FD">JS</td>
        <td align="center" style="background-color:#D9E7FD">ESNAULT</td>
        <td align="center" style="background-color:#D9E7FD">06 03 00 70 80</td>
    </tr>
    <tr>
        <td align="center" colspan="4"></td>
        <td align="center" style="background-color:#D9E7FD">Max</td>
        <td align="center" style="background-color:#D9E7FD">JAZZALBERTVILLE</td>
        <td align="center" style="background-color:#D9E7FD">06 98 54 59 78</td>
    </tr>
</table>
EOD;

$pdf->writeHTML($tbl, true, false, false, false, '');
$pdf->Output('test.pdf', 'I');
exit;
require_once('C:\Users\administrator\testjelix\vendor\technickcom\tcpdf\examples\tcpdf_include.php');
类FdrPdf扩展了TCPDF{
私人$invoice_footer;
//页眉
公共函数头(){
//标志
$image\u file=K\u PATH\u IMAGES.'C:\Users\administrator\testjelix\gp logo.jpg';
$this->Image($Image_文件,10,10,15','JPG','T','false,300','false,false,false,0,false,false,false,false);
//设置字体
$this->SetFont('helvetica','B',35);
//头衔
$this->Cell(0,15,'Feuille de route',0,false,'C',0,'false,'M',M');
}
//页脚
公共函数页脚(){
//放置在距离底部15 mm处
$this->SetY(-15);
//设置字体
$this->SetFont('helvetica','I',8);
//页码
$this->Cell(0,10,'Page'.$this->getAliasNumPage()./'.。$this->getAliasNbPages(),0,false,'C',0',false,'T','M');
$this->invoice\u footer='Document généréle'。$dtnow->toString(jDateTime::LANG_DFORMAT)。'a'。substr($dtnow->toString(jDateTime::LANG_TFORMAT),0,-3)。'via me.org-www.me.org';
}
}
//创建新的PDF文档
$pdf=新的FdrPdf;
//设置文档信息
$pdf->SetCreator(pdf\u CREATOR);
$pdf->SetAuthor('Me');
$pdf->SetTitle('Feuille de route');
$pdf->SetSubject('GB');
$pdf->SetKeywords('TCPDF,pdf,示例,测试,指南');
//设置自动分页符
$pdf->SetAutoPageBreak(TRUE,pdf\u MARGIN\u BOTTOM);
// ---------------------------------------------------------
//设置字体
$pdf->SetFont('helvetica','',35);
//添加页面
$pdf->AddPage('L','A4');
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
$pdf->Ln(40);
$pdf->SetFont('helvetica','',11);
//单元格($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='',$stretch=0,$ignore\U min\U height=false,$calign='T',$valign='M')
$pdf->Cell(0,0,'covid19',1,1,'C',0,'1);
$pdf->MultiCell(0,2,'作为新冠疫情爆发的理由,我们的先辈们吹捧着为公众和公众提供安全和健康服务的卫生服务。假面港是为您提供卫生服务的义务,您可以在节日期间享受独立的卫生服务。您的脸上有什么特别的颜色e arrivée.“0”、“0、1”、“真”;
$pdf->Cell(0,0,'SOIREE',1,2,'C',0',3);
$pdf->MultiCell(0,2,'Chaque soir,après votre sénce,nous vous donnons RDV au Garage/librarie des Baugesápartir de 22:00,22:30 pour partager un time autour d'un verre(ou non.),En toute s curitéet qui tude.”,0,'0,'1,'',true);
$pdf->Cell(0,0,'VOUS ET VOTRE CHARGE D'ACCUEIL',1,1,'C',0',3);

$tbl=这就是你的全部代码吗?不,我有很多单元格在后面,我只是发布了开头。只有页眉不显示?不,页脚也不显示。我一点也不掌握语法,我从这样一个示例中选取了这一个:。我认为我做得很好,我不知道卡住了什么
$pdf->setPrintHeader(true);$pdf->setPrintFooter(true);
如果没有,请添加此行。