MINI
C:
/
SiakApp2.2
/
lib
/
Upload File:
files >> C:/SiakApp2.2/lib/totalhtml.php
<?php function to_pdf($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); fclose($article_f); unset($string); $pathExec = '"'.getcwd().'\\htmltopdf.exe" "'.$mytemp.'" "'.$mytemppdf.'" -ps '.$paper.' -po '.$orientation.' -c pdf'; //$pdf=fopen("http://localhost:8082/cetak/pdf.php?exec=".urlencode ($pathExec),"r"); //echo $pathExec; $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Exec($pathExec); $url="cetak/pdf.php?exec=".urlencode ($pathExec)."&pdf=".$mytemppdf."&path=".$pdf_path; $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(2); }else $sama_ukuran=true; } clearstatcache(); } else sleep(1); } //unlink($mytemp); //$pdfDelete = getcwd(). //unlink($mytemppdf); //return $url; return $pdf_path; } ?>
Copyright ©2021 || Defacer Indonesia