2012-12-24 17 views
9

Właśnie użyłem mPDF na moim projekcie, a teraz utknąłem na tym problemie. Najpierw opiszę moją strukturę PDF:mPDF wyłącz numer strony, nagłówek i stopkę na pierwszej stronie

  1. Pierwsza strona to strona tytułowa.
  2. Druga strona to strona spisu treści.
  3. Trzecia strona to strona z treścią.

Więc problem jest:

  1. Istnieje nagłówek, stopkę, numer strony na stronie tytułowej i strony TOC. Jak mogę to usunąć?
  2. Numer strony treści rozpoczyna się bez 3. Jak zresetować go, aby stał się numerem 1?

Poniżej znajduje się kod służy do zawierać nagłówek i stopkę

$mpdf->SetHeader('{DATE j-m-Y}|{PAGENO}/2|My document'); 
$mpdf->SetFooter('{PAGENO}'); /* defines footer for Odd and Even Pages - placed at Outer margin */ 
$mpdf->SetFooter(array(
     'L' => array(
     'content' => 'Text to go on the left', 
     'font-family' => 'sans-serif', 
     'font-style' => 'B',  /* blank, B, I, or BI */ 
     'font-size' => '10',  /* in pts */ 
     ), 
     'C' => array(
     'content' => '- {PAGENO} -', 
     'font-family' => 'serif', 
     'font-style' => 'BI', 
     'font-size' => '18',  /* gives default */ 
     ), 
     'R' => array(
     'content' => 'Printed @ {DATE j-m-Y H:m}', 
     'font-family' => 'monospace', 
     'font-style' => '', 
     'font-size' => '10', 
     ), 
     'line' => 1,   /* 1 to include line below header/above footer */ 
), 'E'  /* defines footer for Even Pages */ 
); 

a dla strony TOC, dodaję ten tag w html

<tocpagebreak /> 

Odpowiedz

8

można skonfigurować swoją stopkę być najpierw niewidoczny, a następnie resetowany, gdy chcesz rozpocząć numerowanie. Na przykład (przy użyciu tagów HTML):

<!-- sets up the footer --> 
<pagefooter name="footer" content-center="{PAGENO}"></pagefooter> 

<!-- disables it --> 
<setpagefooter value="off"></setpagefooter> 

<p>Some content for the first pages</p> 

<!-- activates the footer and resets the numbering --> 
<pagebreak odd-footer-name="footer" odd-footer-value="on" resetpagenum="1"></pagebreak> 

Jestem całkiem pewien, że to samo można osiągnąć za pomocą metod równoważnych mpdf.

+0

Mam numer strony startowej z drugiej strony, jak zacząć w mpdf .. –

Powiązane problemy