Código PHP:
session_start();
class PDF extends FPDF
{
//Pie de página
function Footer()
{
$this->SetY(-190);
$this->SetFont('Arial','I',12);
$this->Image('images/cor2.png',26,601,566,180);
$this->Cell(110,18,'',0,0,'L');
$this->Cell(0,18,$forma1=($_GET['for']),0,1,'L');//FORMA DE PAGO
$this->Cell(405,18,'',0,0,'L');
$this->Cell(70,18,'',0,0,'L');
$this->Cell(0,18,$subtotal=array_sum($_SESSION['precio']),0,1,'R');//subtotal
$this->Cell(405,18,numtoletras($_POST['cantidad']),0,0,'L');
$this->Cell(70,18,'',0,0,'L');
$this->Cell(0,18,$iva=$subtotal*$_GET['imp'],0,1,'R');//iva%
$this->Cell(405,18,'',0,0,'L');
$this->Cell(70,18,'',0,0,'L');
$this->Cell(0,18,$to=$subtotal+$iva,0,1,'R');//TOTAL
}
}
//Creación del objeto de la clase heredada
$pdf=new PDF('p','pt','letter');
$pdf->AddPage();
$pdf->SetFont('Arial','',26);
//Aquí escribimos lo que deseamos mostrar
$_POST['cantidad']=$subtotal=array_sum($_SESSION['precio'])+array_sum($_SESSION['precio']) * $_GET['imp'];
$nombre=($_GET['no']);
$direccion=($_GET['di']);
$rfc=($_GET['rfc']);
$correo=($_GET['cor']);
$codigo=($_GET['cod']);
$pedido=($_GET['ped']);
$dia = date(j);
$mes = date(m);
$año = date(Y);
$pdf->Image('images/cor.png', 26,27,570,748,'png', 'http://www.corporacion-metalica.com');
$pdf->Cell(0,50,"",0,1);
$pdf->Cell(455,18,"",0,0);
$pdf->SetFont('Arial','I',18);
$pdf->SetTextColor(204,0,51);
$pdf->Cell(0,18,$gavo,0,1,'C');
$pdf->SetFont('Arial','I',12);
$pdf->SetTextColor(0,0,0);
$pdf->Cell(0,18,"",0,1);
$pdf->Cell(358,17,$nombre,0,0,'C');//cliente nombre
$pdf->Cell(49,17,$pedido,0,0,'C');//pedido
$pdf->Cell(49,17,$dia,0,0,'C');//dia
$pdf->Cell(49,17,$mes,0,0,'C');//mes
$pdf->Cell(0,17,$año,0,1,'C');//año
$pdf->Cell(358,17,$direccion,0,1,'C');//cliente direccion
$pdf->Cell(179,18,$correo,0,0,'C');//clientecorreo
$pdf->Cell(179,18,$codigo,0,0,'C');//codigo de area
$pdf->Cell(0,18,$rfc,0,1,'C');//rfc del cliente
$pdf->Cell(0,18,"",0,1);
//matrices asociativas
$filas=count($_SESSION['w']);
for ($fil = 0; $fil < $filas; $fil++) {
$pdf->Cell(53,18,$_SESSION['result'][0][0][$fil],0,0,'C');//cuerpo de la factura (1)
$pdf->Cell(78,18,$_SESSION['result'][0][1][$fil],0,0,'C');
$pdf->Cell(277,18,$_SESSION['result'][0][2][$fil],0,0,'L');
$pdf->Cell(71,18,$_SESSION['result'][0][3][$fil],0,0,'R');
$pdf->Cell(0,18,$r=$_SESSION['result'][0][3][$fil]*$_SESSION['result'][0][0][$fil],0,1,'R');
}
$pdf->Output('Factura.pdf','I');