Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require("fpdf16/fpdf.php");
- define("FPDF_FONTPATH", "fpdf16/font/");
- if(!isset($_POST["btnEnviar"])){
- $archivo=file("Tema9.txt");
- $pdf=new FPDF("P","cm","A4");
- $pdf->SetMargins($_POST["lateral"],$_POST["supInf"]);
- $pdf->AddPage();
- $contador=1;
- foreach($archivo as $numLinea => $linea){
- if($contador == 3){
- $pdf->SetAutoPageBreak(1,$_POST["supInf"]);
- $pdf->SetFont( "Helvetica", "UB");
- $pdf->SetTextColor(0,255,0);
- $pdf->write(1,utf8_decode($linea));
- $pdf->Ln(5);
- $contador = 1;
- }else{
- switch($contador){
- case 1:
- $contador++;
- $pdf->SetAutoPageBreak(1,$_POST["supInf"]);
- $pdf->SetFont( "Arial", "U");
- $pdf->SetTextColor(255,0,0);
- $pdf->write(1,utf8_decode($linea));
- break;
- case 2:
- $contador++;
- $pdf->SetAutoPageBreak(1,$_POST["supInf"]);
- $pdf->SetFont( "Times", "B");
- $pdf->SetTextColor(0,0,255);
- $pdf->SetX($_POST["lateral"]+2);
- $pdf->write(1,utf8_decode($linea));
- break;
- }
- }
- }
- $pdf->Output();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement