4include_once(
"./Services/Preview/classes/class.ilFilePreviewRenderer.php");
30 if (self::$supported_formats ==
null)
31 self::$supported_formats = explode(
",", self::SUPPORTED_FORMATS);
41 return (PATH_TO_GHOSTSCRIPT !=
"");
56 $filepath = $obj->getFile();
63 $outputFile = $output .
"_#02d.png";
69 "-dBATCH -dNOPAUSE -dSAFER -dFirstPage=1 -dLastPage=%d -sDEVICE=pngalpha -dEPSCrop -r72 -o %s %s",
77 if ($filepath != $inputFile)
82 $outputFile = str_replace(
"#",
"%", $outputFile);
84 for ($i = 1; $i <= $numOfPreviews; $i++)
86 $imagePath = sprintf($outputFile, $i);
87 if (!file_exists($imagePath))
Abstract parent class for all file preview renderer classes.
prepareFileForExec($filepath)
Checks whether the specified file path can be used with exec() commands.
Preview renderer class that is able to create previews from PDF, PS and EPS by using GhostScript.
static $supported_formats
getSupportedFileFormats()
Gets an array containing the file formats that are supported by the renderer.
static isGhostscriptInstalled()
Determines whether Ghostscript is installed.
renderImages($obj)
Renders the specified object into images.
getMaximumNumberOfPreviews()
Gets the maximum number of preview pictures per object.
Represents an image that was created from a preview renderer and that can be further processed to cre...
static escapeShellArg($a_arg)
static execQuoted($cmd, $args=NULL)
exec command and fix spaces on windows
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.