{{-- PdfReportLayout - the house style for downloadable PDF reports. The masthead is unchanged in substance: coat of arms left, the agency block centred, the WMA mark right, exactly where they have always been. What is new is everything around it - an accent rule, a titled document band, a meta strip and a typographic scale that make the page read as a published report rather than a printed screen. mPDF renders no flexbox and no grid, so the layout is built on tables with fixed widths. That is deliberate; do not "modernise" it into flex. Sections a report fills in: @section('doc_title') the document's name, e.g. "Water Meter Verification Report" @section('doc_subtitle') one line under it @section('meta') rows of labelvalue, shown in the strip @section('content') the body $stampImage, when given (ReportPdf supplies it), is the office stamp uploaded under Settings → Collection Centres; it closes the report, bottom right. --}} @php $emblemPath = public_path('assets/images/emblem.jpeg'); $emblemSrc = file_exists($emblemPath) ? 'data:image/jpeg;base64,' . base64_encode(file_get_contents($emblemPath)) : ''; $wmaPath = public_path('assets/images/wmalogo.png'); $wmaSrc = file_exists($wmaPath) ? 'data:image/png;base64,' . base64_encode(file_get_contents($wmaPath)) : ''; // Which office the report speaks for. A report scoped to one collection // centre carries that centre's own address, so the copy that leaves the // building says where it came from; a national report keeps head office. // Reports that pass no $office are unaffected - they get exactly what they // got before. $officeName = $office['name'] ?? null; $officeAddress = $office['address'] ?? 'P.O. Box 30386, Kibaha'; $officeTel = $office['tel'] ?? '0784 729 365'; $officeEmail = $office['email'] ?? 'info@wma.go.tz'; @endphp @yield('doc_title', 'Report') {{-- Masthead - crest left, agency centred, WMA mark right. Unmoved by design. --}}
@if($emblemSrc) Coat of Arms @endif
The United Republic of Tanzania
Ministry of Industry and Trade
Weights and Measures Agency
Wakala wa Vipimo
@if($officeName)
{{ $officeName }} Office — Ofisi ya {{ $officeName }}
@endif
{{ $officeAddress }}  ·  Tel: {{ $officeTel }}  ·  {{ $officeEmail }}
@if($wmaSrc) WMA @endif
@yield('doc_title')
@yield('doc_subtitle')
@hasSection('meta') @yield('meta')
@endif @yield('content') @if(!empty($stampImage))
Official stamp
Official Stamp
@endif