Ich möchte meine HTML-Seite in PDF konvertieren, aber ich kann es nicht tun. Vielleicht weißt du, was ich falsch mache? Hier ist mein CodeKann nicht konvertieren Tabelle mit Dompdf in Laravel
web.php
Route::get('print/{id}',array('as'=>'htmltopdfview','uses'=>'[email protected]'));
Controller:
public function htmltopdfview(Request $request)
{
$products = Client::all();
view()->share('products',$products);
if($request->has('download')){
$pdf = PDF::loadView('client/print');
return $pdf->download('client/print');
}
return view('client/print' compact('client'));
}
und Aussicht:
<a href="{{ route('htmltopdfview',['download'=>'pdf']) }}">Download PDF</a>
<div class="panel-body">
{!! Form::open(['action' => ['[email protected]', $client->id]]) !!}
{!! Form::label('name', 'Imie i nazwisko:'); !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::submit('Edit!', ['class' => 'btn btn-success']) !!}
{!! Form::close() !!}
Ich habe so etwas getan: öffentliche Funktion htmtopdfview (Request $ Anfrage) { $ products = Client :: all(); view() -> share ('products', $ products); $ pdf = PDF :: loadView ('home'); Rückgabe $ pdf-> stream(); } und meine Seite wird nur geladen und nichts mehr ... –