37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
|
|
<?php
|
|
date_default_timezone_set('America/Chicago');
|
|
require dirname( __DIR__, 4 ) . "/portal/dashboard/core/api/php/init.php";
|
|
require dirname( __DIR__, 4 ) . "/portal/dashboard/core/api/php/send_email2.php";
|
|
require dirname( __DIR__, 4 ) . "/portal/dashboard/core/api/php/libs/dompdf/vendor/autoload.php";
|
|
require dirname( __DIR__, 4 ) . "/portal/dashboard/core/api/php/functions.php";
|
|
|
|
// https://www15.cradle2careertx.xyz/portal/dashboard/services/forms/request.php
|
|
|
|
|
|
|
|
$options = new Dompdf\Options;
|
|
$options->setChroot("/mnt/" . $domain['SystemUser'] . "/forms/templates/");
|
|
$options->setIsRemoteEnabled(true);
|
|
$dompdf = new Dompdf\Dompdf($options);
|
|
|
|
$template = "/mnt/" . $domain['SystemUser'] . "/forms/templates/pdf_template.html";
|
|
$html = file_get_contents($template);
|
|
// $html = str_replace(["{{ name }}", "{{ quantity }}"], [$name, $quantity], $html);
|
|
|
|
$dompdf->loadHtml($html);
|
|
//$dompdf->loadHtmlFile("template.html");
|
|
$dompdf->render();
|
|
$dompdf->addInfo("Title", "An Example PDF"); // "add_info" in earlier versions of Dompdf
|
|
|
|
|
|
$dompdf->stream("invoice2.pdf", ["Attachment" => 0]);
|
|
// $output = $dompdf->output();
|
|
// $filename = "file.pdf";
|
|
// file_put_contents($filename, $output);
|
|
|
|
|
|
?>
|
|
|
|
|