How to show data with formats in a pdf

0

I have a textarea with an editor to send data with formats such as in bold, bullets, etc. and when I show that data in a pdf it shows them as follows:

<p><b>LUGAR: </b>En estudio</p><p><b>CAPELLÁN:</b> En estudio</p><p>OBJETIVO DE

You do not show them to me with the format. I am using dompdf , laravel and angular .

So I make the call to dompdf :

public function crearPDF($datos, $actividades, $vistaurl, $tipo){
    $data = $datos;
    $actividades = $actividades;
    $date = date('Y-m-d');
    $view = \View::make($vistaurl, compact('data', 'actividades', 'date'))->render();
    $pdf = \App::make('dompdf.wrapper');
    $pdf->loadHTML($view);

    if($tipo==1){
        return $pdf->stream('reporte.pdf');
    }
    if($tipo==2){
        return $pdf->download('reporte.pdf');
        }
    }
    
asked by Ziul̺̿i̺̿n̺̿g̺̿ Maca̶yo 08.08.2017 в 04:16
source

1 answer

0

You are creating a view to load it with dompdf then use the PDF facade with the loadView method:

$pdf = \PDF::loadView($vistaurl, ['data' => $data, 'actividades' => $actividades, 'date' => $date]);
    
answered by 26.10.2017 в 03:20