31 lines
665 B
PHP
31 lines
665 B
PHP
<?php
|
|
use Barryvdh\DomPDF\Facade\Pdf;
|
|
$documentInfo = document_template(get("id"));
|
|
$j = j($documentInfo->json);
|
|
$pageSize = isset($j['page']) ? $j['page'] : "A4";
|
|
$pdf = App::make('dompdf.wrapper');
|
|
$pdf->setPaper($pageSize, $j['paper']);
|
|
$pdf->setOption([
|
|
'dpi' => $j['dpi'],
|
|
/*
|
|
'defaultFont' => 'sans-serif',
|
|
'margin_left' => 10,
|
|
'margin_right' => 10,
|
|
'margin_top' => 10,
|
|
'margin_bottom' => 10,
|
|
*/
|
|
]);
|
|
|
|
$fileName = get("title");
|
|
|
|
|
|
|
|
$document = pdf_html_content($documentInfo->html);
|
|
$path = "test";
|
|
|
|
$path = "$path/$fileName";
|
|
html_create($path, $document, $j['paper']);
|
|
|
|
yonlendir(url("storage/documents/$path.pdf"));
|
|
?>
|