13 public $error=array();
27 public function convert($name,$id=null,$pdfSource=null,$jpgOutDir=null,$quality=null)
29 ignore_user_abort(
true);
30 $id = ($id === null ?
'Guests' : $id);
31 $pdfSource = ($pdfSource === null ?
'./' : $pdfSource);
32 $jpgOutDir = ($jpgOutDir === null ?
'./' : $jpgOutDir);
33 $quality = ($quality === null ? 100 : $quality);
35 $imagick =
new Imagick();
36 chmod($pdfSource,0777);
37 chmod($jpgOutDir,0777);
39 mkdir($jpgOutDir.
"/user$id",0777);
40 rmdir($jpgOutDir.
"/user$id/$name");
41 mkdir($jpgOutDir.
"/user$id/$name",0777);
42 chmod($jpgOutDir.
"/user$id/",0777);
43 chmod($jpgOutDir.
"/user$id/$name/",0777);
49 $this->
outPath($jpgOutDir.
"/user".$id.
"/".$name.
"/".$name.
"[".$i.
"].jpg");
52 $imagick->setResolution(144,144);
53 $imagick->readImage($this->
inPath($pdfSource.
"/user".$id.
"/".$name.
"[".$i.
"]"));
55 $imagick->setImageCompressionQuality($quality);
60 $imagick->writeImage($this->
outPath($jpgOutDir.
"/user".$id.
"/".$name.
"/".$name.
"[".$i.
"].jpg"));
65 $this->error[$i] = $e;
66 $this->error[
'message'] =
'Imagick Exception: '.$e;
83 public function simulation($name,$id=null,$pdfSource=null)
85 $id = ($id === null ?
'Guests' : $id);
86 $pdfSource = ($pdfSource === null ?
'./' : $pdfSource);
88 $imagick =
new Imagick();
96 $imagick->readImage($this->
inPath($pdfSource.
"/user".$id.
"/".$name.
"[".$i.
"]"));
105 return array(
'maxPage'=>$this->j,
107 'source'=>$pdfSource.
"/user".$id.
"/".$name);
122 $id = ($id === null ?
'Guests' : $id);
123 $pdfSource = ($pdfSource === null ?
'./' : $pdfSource);
125 return array(
'maxPage'=>
'unknown',
126 'minPage'=>
'unknown',
127 'source'=>$pdfSource.
"/user".$id.
"/".$name);
143 $this->path[
'in'] = $path;
153 $this->path[
'out'] = $path;
simulation($name, $id=null, $pdfSource=null)
convert($name, $id=null, $pdfSource=null, $jpgOutDir=null, $quality=null)
pdfPathGenerator($name, $id=null, $pdfSource=null)