Guest User

Untitled

a guest
Jul 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. require_once("fpdf/fpdf.php");
  2. $pdf= new FPDF("P","pt","A4");
  3. $pdf->AddPage();
  4.  
  5. $pdf->SetFont('arial','B',18);
  6. $pdf->Cell(0,5,"Relatório",0,1,'C');
  7. $pdf->Cell(0,5,"","B",1,'C');
  8. $pdf->Ln(50);
  9.  
  10. //cabeçalho da tabela
  11. $pdf->SetFont('arial','B',14);
  12. $pdf->Cell(130,20,'Coluna 1',1,0,"L");
  13. $pdf->Cell(140,20,'Coluna 2',1,0,"L");
  14. $pdf->Cell(130,20,'Coluna 3',1,0,"L");
  15. $pdf->Cell(160,20,'Coluna 4',1,1,"L");
  16.  
  17. //linhas da tabela
  18. $pdf->SetFont('arial','',12);
  19. for($i= 1; $i <10;$i++){
  20. $pdf->Cell(130,20,"Linha ".$i,1,0,"L");
  21. $pdf->Cell(140,20,rand(),1,0,"L");
  22. $pdf->Cell(130,20,rand(),1,0,"L");
  23. $pdf->Cell(160,20,rand(),1,1,"L");
  24. }
  25. $pdf->Output("arquivo.pdf","D");
  26.  
  27. $pdf->Output("arquivo.pdf","D");
Add Comment
Please, Sign In to add comment