Demoins Posted March 6, 2009 at 11:04 PM Report Share #248831 Posted March 6, 2009 at 11:04 PM Alguém sabe e pode me explicar como colocar o header e footer utilizando a class HTML2FPDF? eu tento assim: class pdf extends html2fpdf { function Header() { // Logo $this -> Image('../images/logo.gif',10,10,33); // Arial bold 15 $this -> SetFont('Arial','B',13); //Calculate width of title and position $w = $this->GetStringWidth($title)+6; $this -> SetX((210-$w)/2); // Move to the right // $this->Cell(80); // Title $this -> Cell($w,9,$title,0,0,'C',1); // Line break $this -> Ln(20); } function Footer() { //To be implemented in your own inherited class // Position at 1.5 cm from bottom $this -> SetY(-15); // Arial italic 8 $this -> SetFont('Arial','I',8); // Page number $this -> Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } } $pdf = new html2fpdf(); $pdf -> AliasNbPages(); $pdf -> AddPage(); $pdf -> SetFont('Arial', '', 12); $line = '<table id="comp_portfolio"> <tr> <td align="left" colspan="2"> <h4>Título</h4> </td> </tr> <tr> <td> item </td> <td> Descrição </td> </tr> </table>'; $pdf -> writehtml($line); $pdf -> Output('List.pdf', 'D'); mas o problema é que não acontece nada :S Se me pudessem ajudar, agradecia 😉 Link to comment Share on other sites More sharing options...
anolsi Posted March 7, 2009 at 11:14 AM Report Share #248880 Posted March 7, 2009 at 11:14 AM $pdf = new html2fpdf(); Esta linha não pode ser assim, tem que ser: $pdf = new pdf(); Que é a classe herdeira, e que tem o novo footer e o novo header "Nós somos o que fazemos repetidamente, a excelência não é um feito, e sim, um hábito."Não respondo a questões por PM que possam ser colocadas no fórum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now