 if ( isset($pdf) ) {
    $font = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "italic");
    $fontBold = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "normal");

    $fecha = '{{$data->fecha}}';
    $nombre = str_replace('&quot;', '"', '{{$data->Nombre}}');
    $Desincorporacion = '{{$data->numero}}';

    // Obtener el ancho de la página
    $pageWidth = $pdf->get_width();

    // Calcular la posición centrada para cada línea de texto
    $nombreWidth = $fontMetrics->getTextWidth($nombre, $fontBold, 11);

    $fechaWidth = $fontMetrics->getTextWidth("Página {PAGE_NUM} de {PAGE_COUNT} - $fecha", $font, 10);

    $desincorporacionWidth = $fontMetrics->getTextWidth("Desincorporación Nº $Desincorporacion (ACTA NO ORIGINAL)", $font, 8);

    $pdf->page_text(($pageWidth - $nombreWidth) / 2, 780, "$nombre", $fontBold, 11, array(57/255, 57/255, 57/255));

    $pdf->page_text(210, 800, "Página {PAGE_NUM} de {PAGE_COUNT} - $fecha", $font, 10, array(87/255, 87/255, 87/255));

    $pdf->page_text(($pageWidth - $desincorporacionWidth) / 2, 820, "Desincorporación Nº $Desincorporacion (ACTA NO ORIGINAL)", $font, 8, array(87/255, 87/255, 87/255));
}