Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

790
Vistas
ErrorException in Cpdf.php line 3855: Undefined index: at barryvdh/laravel-dompdf

I am using laravel 5.2, The dompdf runs fine at localhost but when moved to AWS it keeps showing ErrorException in Cpdf.php line 3855: Undefined index:, in this line (3855) has font variable.

Sample code :

$html = "<h2>Hello</h2>";
PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);
$pdf = PDF::loadHTML($html)->setPaper('a4', 'landscape');
return $pdf->download('pdfview.pdf');

I can not set 'currentFont' => 'sans-serif' at setOptions due to no options in barryvdh/laravel-dompdf. so how can I solve currentFont issue.

Localhost - Windows - Runs fine.

AWS - Linux - Error.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Error solved by delete dompdf_font_family_cache.php file from storage/fonts and let the renderer regenerate the cache.

about 4 years ago · Santiago Trujillo Denunciar

0

I faced this issue on the Linux machine. The error shown was

Undefined index: application/third_party/dompdf/lib/fonts\Times-Roman

If you observe the Directory separator before the font name '\' is not compatible in Linux environment. This path separator is hardcoded in the dompdf_font_family_cache.php file found in ../dompdf/lib/fonts folder.

Open the file in the editor and replace '\' with '/'. Save the changes. The code will start working.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda