26 lines
705 B
PHP
26 lines
705 B
PHP
<?php
|
|
require_once 'dompdf/autoload.inc.php';
|
|
include('log_entry.php');
|
|
$param = $_REQUEST['param'];
|
|
// $param = str_replace(' ', '_', $_REQUEST['param']);
|
|
$param_value = $_REQUEST['param_value'];
|
|
$FileName = 'DocumentPdf/'.$param.'_'.$param_value.'.pdf';
|
|
error_log("FileName : ".$FileName);
|
|
|
|
use Dompdf\Dompdf;
|
|
$dompdf = new Dompdf();
|
|
$pdfVal ='';
|
|
|
|
if($_REQUEST['htmlText'] != "")
|
|
{
|
|
$pdfVal =$pdfVal.$_REQUEST['htmlText'];
|
|
}
|
|
$pdfVal = mb_convert_encoding($pdfVal, 'HTML-ENTITIES', 'UTF-8');
|
|
$dompdf->loadHtml($pdfVal);
|
|
$dompdf->setPaper('A4', 'potrait');
|
|
$dompdf->render();
|
|
$dompdf->stream("DocumentPdf", array("Attachment" => 0));
|
|
$output = $dompdf->output();
|
|
file_put_contents($FileName, $output);
|
|
|
|
?>
|