I'm trying to create a pdf file with the library barryvdh/laravel-dompdf
. In other projects, I can show that in pdfs, it's used bootstrap style. Now I'm trying to create pdfs with this library, and bootstrap. I'm reading that only can use bootstrap 3.3.7 version. I added this version to my project, but many style it has applied. I need created one pdf with this structure:
But I'm getting this:
cols, they do not maintain structure, and I don't know why. If I show this blade in webrowser, doing return view()
I can show all my page perfectly, and all ok. But in PDF, I can to do that maintain structure. For example, my code is:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{{ asset('css/337.min.css') }}">
<link rel="stylesheet" href="{{ asset('css/style_installation.css') }}">
</head>
<body>
<div class="row">
<div class="col-xs-11">
@for($i = 0; $i < $allData["totalInstallableItems"]; $i++)
<h5 class="header bg-dark text-white prod size-font-1">
{{ strlen($allData["item_name_$i"]) > 56 ? substr($allData["item_name_$i"], 0, 56)."..." : $allData["item_name_$i"] }}
</h5>
@endfor
</div>
<div class="col-xs-1">
<div class="checks-wrapper">
@for($x = 0; $x < $allData["totalInstallableItems"]; $x++)
<div class="check">
<img class="img" src="{{ asset('images/installations_pdf/mark.png') }}" />
</div>
@endfor
</div>
</div>
{{--<div class="col-xs-4">
@if($hayDepuradora)
<img class="img-fluid d-block" src="data:image/png;base64,{{DNS1D::getBarcodePNG($parte->anotacion->n_serie, 'C128')}}" style="width:100%;margin-top: 34px;">
<span class="d-block text-center serial_number">N/S: {{ $parte->anotacion->n_serie }}</span>
<span class="d-block text-center description">
{{ strlen($parte->articulos[$indexDepuradora]->descripcion) > 45 ? substr($parte->articulos[$indexDepuradora]->descripcion,0,45)."..." : $parte->articulos[$indexDepuradora]->descripcion }}
</span>
@endif
</div>
</div>--}}
<div class="container-height"></div>
<div class="row">
<div class="col-xs-4 box">
<span class="title">Nº DE CONTRATO.:</span> {{ $allData["n_contract"] }}
</div>
<div class="col-xs-4 box">
<span class="title">Nº DE CLIENTE.:</span> {{ $allData["n_client"] }}
</div>
<div class="col-xs-4 box">
<span class="title">FECHA.:</span> {{ Carbon\Carbon::parse($allData["contract_date"])->format('d/m/Y') }}
</div>
</div>
My question is. Does anybody know if there exists any library that allows the use of bootstrap style? or does anybody know what is my problem?
I'm reading this tutorial to create my PDF: https://github.com/barryvdh/laravel-dompdf
Thanks for helping me and happy new year.