Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

fezinha

Número da página em FPDF

Recommended Posts

Oi Felipe,

 

Eu tenho a seguinte código:

 

class PDF extends FPDF

{

//Page header

function Header()

{

if ($GLOBALS['teste'] <> '')

{

$this->SetFont('Arial','B',10);

$this->MultiCell(0,5,$GLOBALS['teste'],'LTRB','J',0);

}

$this->SetFont('Arial','',10);

}

 

function Footer()

{

//Position at 1.5 cm from bottom

$this->SetY(-18);

//Arial italic 8

$this->SetFont('Arial','',8);

$this->Line(10,275, 200, 275);

//Page number

$foot = "EMPRESA\n";

$foot .= "Página ".$this->PageNo()."/{nb}";

$this->SetX(30);

$this->MultiCell(0,3,$foot,0,'C');

}

 

var $col=0;

 

function SetCol($col)

{

//Move position to a column

$this->col=$col;

$x=10+$col*65;

$this->SetLeftMargin($x);

$this->SetX($x);

}

}

 

$pdf = new PDF('P','mm');

$pdf->Open();

$pdf->AddPage();

$pdf->AliasNbPages();

$pdf->SetAutoPageBreak(true,18);

 

$pdf->SetFont('Arial','B',10);

$teste = 'Ementa do curso';

if (round($pdf->GETY()) < 278)

{

$pdf->MultiCell(0,5,'Ementa do curso','LTRB','J',0);

}

$GLOBALS['imprime'] = 0;

$pdf->SetFont('Arial','',10);

$x = 'X ';

$i = 0;

$ementa = '';

for ($i==0;$i<3500;$i++)

{

$ementa = $ementa . $x;

}

$pdf->MultiCell(0,5,$ementa,'LTRB','J',0);

$pdf->Ln(8);

 

$pdf->SetFont('Arial','B',10);

$teste = 'Objetivos principais';

if (round($pdf->GETY()) < 278)

{

$pdf->MultiCell(0,5,'Objetivos principais','LTRB','J',0);

}

$GLOBALS['imprime'] = 0;

$pdf->SetFont('Arial','',10);

$w = 'W ';

$j = 0;

$obj = '';

for ($j==0;$j<1650;$j++)

{

$obj = $obj . $w;

}

$pdf->MultiCell(0,5,$obj,'LTRB','J',0);

$pdf->Ln();

 

$pdf->SetFont('Arial','B',10);

$teste = 'Bibliografia';

if (round($pdf->GETY()) < 278)

{

$pdf->MultiCell(0,5,'Bibliografia','LTRB','J',0);

}

$pdf->SetFont('Arial','',10);

$y = 'Y ';

$n = 0;

$bib = '';

for ($n==0;$n<1500;$n++)

{

$bib = $bib . $y;

}

$pdf->MultiCell(0,5,$bib,'LTRB','J',0);

$pdf->Ln();

 

$pdf->Output();

 

Se você perceber, na função FOOTER eu coloquei uma linha para fechar as tabelas.

Mas não última folha, não gostaria que essa linha aparecesse.

 

Você sabe como devo fazer?

 

Obrigada,

 

Fernanda

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.