Detailed Description
Definition at line 2 of file imagick.convert.pdf2jpg.php.
Member Function Documentation
convert |
( |
$ |
name, |
|
|
$ |
id = null , |
|
|
$ |
pdfSource = null , |
|
|
$ |
jpgOutDir = null , |
|
|
$ |
quality = null |
|
) |
| |
Convert PDF to JPG via PHP imagick
- Parameters:
-
string | $name | (name input file) |
number | $id | (numeric user id if system using id) |
string | $pdfSource | (pdf source path) |
string | $jpgOutDir | (jpg out root dir path) |
- Returns:
- number
Definition at line 18 of file imagick.convert.pdf2jpg.php.
{
ignore_user_abort(true);
$id = ($id === null ? 'Guests' : $id);
$pdfSource = ($pdfSource === null ? './' : $pdfSource);
$jpgOutDir = ($jpgOutDir === null ? './' : $jpgOutDir);
$quality = ($quality === null ? 100 : $quality);
$imagick = new Imagick();
chmod($pdfSource,0777);
chmod($jpgOutDir,0777);
mkdir($jpgOutDir."/user$id",0777);
rmdir($jpgOutDir."/user$id/$name");
mkdir($jpgOutDir."/user$id/$name",0777);
chmod($jpgOutDir."/user$id/",0777);
chmod($jpgOutDir."/user$id/$name/",0777);
$i=0;
$this->j=1;
while($i<1000)
{
$this->outPath($jpgOutDir."/user".$id."/".$name."/".$name."[".$i."].jpg");
try
{
$imagick->setResolution(144,144);
$imagick->readImage($this->inPath($pdfSource."/user".$id."/".$name."[".$i."]"));
$imagick->setImageCompressionQuality($quality);
$imagick->writeImage($this->outPath($jpgOutDir."/user".$id."/".$name."/".$name."[".$i."].jpg"));
$this->j++;
}
catch(Exception $e)
{
$this->error[$i] = $e;
$this->error['message'] = 'Imagick Exception: '.$e;
break;
}
$i++;
}
return $this->j;
}
Convert simulation for generate path to source. Without ImageMagic php extension.
- Parameters:
-
string | $name | (name input file) |
number | $id | (numeric user id if system using id) |
string | $pdfSource | (pdf source path) |
- Returns:
- mixed
Definition at line 111 of file imagick.convert.pdf2jpg.php.
{
$id = ($id === null ? 'Guests' : $id);
$pdfSource = ($pdfSource === null ? './' : $pdfSource);
return array('maxPage'=>'unknown',
'minPage'=>'unknown',
'source'=>$pdfSource."/user".$id."/".$name);
}
simulation |
( |
$ |
name, |
|
|
$ |
id = null , |
|
|
$ |
pdfSource = null |
|
) |
| |
Convert simulation
- Parameters:
-
string | $name | (name input file) |
number | $id | (numeric user id if system using id) |
string | $pdfSource | (pdf source path) |
- Returns:
- mixed
Definition at line 74 of file imagick.convert.pdf2jpg.php.
{
$id = ($id === null ? 'Guests' : $id);
$pdfSource = ($pdfSource === null ? './' : $pdfSource);
$imagick = new Imagick();
$i=0;
$this->j=1;
while($i<1000)
{
try
{
$imagick->readImage($this->inPath($pdfSource."/user".$id."/".$name."[".$i."]"));
$this->j++;
}
catch(Exception $e)
{
break;
}
$i++;
}
return array('maxPage'=>$this->j,
'minPage'=>0,
'source'=>$pdfSource."/user".$id."/".$name);
}
Field Documentation
The documentation for this class was generated from the following file: