FPDF Adding Page to More

Asked

Viewed 154 times

1

My document only came a record, but it still generates two pages the function I’m using is this:

function Footer(){ // CRIANDO UM RODAPE

    //$this->SetX(15);
    $this->setY(-15);
    //$this->Rect(10,270,190,20);
    $this->SetFont('Arial','',10);        

    $this->SetFont('Arial','',7);
    $this->Cell(20,7,utf8_decode('Página '.$this->PageNo().' de {nb}'),0,0,'L');
    setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
    date_default_timezone_set('America/Manaus');
    $dia_hoje = date('d');
    $ano_hoje = date('Y');
    $hora_hoje = date('H:i:s');
    $data =  'Manaus, '.ucfirst(gmstrftime('%A')).', '.$dia_hoje.' de '.ucfirst(gmstrftime('%B')).' '.$ano_hoje.' '.$hora_hoje;
    //echo $data;
    $this->SetX(-70);
    $this->Cell(60,7,$data,0,0,'R');

}

If I leave the footer well above type setY(-30) there does not generate the second page I count on your help

1 answer

0

I discovered the mistake.

Actually, it was in my detail that I was screwing up

$i = 0;
while ($agendaList->hasNextAgenda()){
  $i++;
  if($agenda_str == 'S'){
 ...

he was adding many pages when it was several items

Browser other questions tagged

You are not signed in. Login or sign up in order to post.