MINI
C:
/
SiakApp2.2
/
lib
/
Upload File:
files >> C:/SiakApp2.2/lib/wkhtmltopdf.php
<?php function to_pdfwkhtml($string,$paper,$orientation){ $namafile=$_SESSION['symfony/user/sfUser/attributes']['symfony/user/sfUser/attributes']['ses_siak_user']."-".time(). "-" .rand(); $mytemp = getcwd()."/tmppdf/f" . $namafile . ".html"; $pdf_path="tmppdf/f" .$namafile . ".pdf"; $mytemppdf = getcwd().'/'.$pdf_path; $article_f = fopen($mytemp,'w'); fwrite($article_f, $string); unset($string); fclose($article_f); //unset($string); //exec('wkhtmltopdf.exe -q --page-size '.$paper.' --orientation '.$orientation.' "'.$mytemp.'" "'.$mytemppdf.'"'); $pathExec = 'C:\\SiakApp\\web\\wkhtmltopdf.exe --page-size '.$paper.' --orientation '.$orientation.' "'.$mytemp.'" "'.$mytemppdf.'"'; $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run($pathExec, 3, false); $ukuran_awal=0; $sama_ukuran=false; //sleep(2); while(!$sama_ukuran){ if(file_exists($mytemppdf)){ $ukuran=filesize($mytemppdf); if($ukuran==0){ sleep(1); }else{ if($ukuran!=$ukuran_awal){ $ukuran_awal=$ukuran; sleep(3); }else $sama_ukuran=true; } clearstatcache(); } else sleep(1); } //unlink($mytemp); //$pdfDelete = getcwd(). //unlink($mytemppdf); return $pdf_path; } ?>
Copyright ©2021 || Defacer Indonesia