$this->Ln(20);
    }
    function Footer()
    {
        // Position at 1.5 cm from bottom
        $this->SetY(-15);
        // Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 12);
$pdf->Cell(30, 15, "NUMERO DE REFERENCIA: " . $det['num_ref']);
$pdf->Ln();
$pdf->Cell(30, 15, "FOLIO DEL TICKER O COMBROBANTE DE PAGO: " . $det['folio_ficha']);
$pdf->Ln();
$pdf->Cell(30, 15, "NUMERO DE CONTRATO: " . $det['num_ref']);
$pdf->Ln();
$pdf->Cell(30, 15, "NUMERO DE ESTATUS DEL CONTRATO: " . $det['id_contrato']);
$pdf->Ln();
$pdf->Cell(30, 15, "FECHA Y HORA DEL PAGO: " . $det['fecha_pago']);
$pdf->Ln();
$pdf->Cell(30, 15, "FECHA Y HORA DEL REGISTRO DEL PAGO: " . $det['fecha_reg']);
$pdf->Ln();
$pdf->Cell(30, 15, "BANCO DONDE SE REALIZO EL PAGO: " . $det['banco']);
$pdf->Ln();
$pdf->Cell(30, 15, "CUENTA: " . $det['cuenta']);
while ($l = $tabla->NextRow()) {
    $fecha_generacion = $l['fecha_generacion'];
    $monto = $l['monto'];
    break;
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetY(15);
$pdf->Cell(60);
$pdf->Cell(50, 5, utf8_decode("FECHA DE PRÉSTAMO: ") . $fecha_generacion, 0, 0, 'C');
$pdf->Ln();
$pdf->Cell(60);
$pdf->Cell(50, 5, utf8_decode("IMPORTE DEL PRÉSTAMO: \$") . $monto, 0, 0, 'C');
$pdf->Ln(20);
$pdf->SetFont('Times', '', 12);
//tabla de amortizacion
//cabeceras
$pdf->SetFillColor(192, 192, 192);
$fill = true;
if ($_GET['tipo_tabla'] == 'original') {
    $pdf->SetFont("Arial", "B", 8);
    $pdf->Cell(10, 6, "#", 1, "", "", $fill);
    $pdf->Cell(27, 6, "SALDO INSOLUTO", 1, "", "", $fill);
    $pdf->Cell(30, 6, "CAPITAL PAGADO", 1, "", "", $fill);
    $pdf->Cell(35, 6, "% INTERES ", 1, "", "", $fill);
    $pdf->Cell(33, 6, "INTERES", 1, "", "", $fill);
    $pdf->Cell(25, 6, "PAGO", 1, "", "", $fill);
    $pdf->Cell(35, 6, "FECHA DE PAGO", 1, "", "", $fill);
    //cuerpo de la tabla
    $pdf->SetFillColor(224, 224, 224);
include_once "../controller/cContratos.php";
$contra = new cContratos();
$texto = $contra->getTextoContratos($_GET['contrato']);
require '../fpdf/fpdf.php';
class ImprimeTabla extends FPDF
{
    function Header()
    {
        $this->bgImage(10, 10);
    }
    function Footer()
    {
        // Position at 1.5 cm from bottom
        $this->SetY(-15);
        // Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
    function bgImage($x, $y)
    {
        //Text rotated around its origin
        $this->Image("../logo_wm.png", $x, $y, 160, 180, "png");
    }
}
$pdf = new ImprimeTabla();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 7);
$pdf->MultiCell(193, 4, $texto);
$pdf->Output();