本文整理汇总了PHP中pdf::find_gs方法的典型用法代码示例。如果您正苦于以下问题:PHP pdf::find_gs方法的具体用法?PHP pdf::find_gs怎么用?PHP pdf::find_gs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdf
的用法示例。
在下文中一共展示了pdf::find_gs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: movie_get_file_metadata
/**
* Get PDF file metadata (height and width)
* (ref: movie::get_file_metadata())
*/
static function movie_get_file_metadata($file_path, $metadata)
{
if (strtolower(pathinfo($file_path, PATHINFO_EXTENSION)) == "pdf" && ($path = pdf::find_gs())) {
// Parsing gs output properly can be a pain. So, let's go for a reliable albeit inefficient
// approach: re-extract the frame (into tmp) and get its image size.
$temp_file = system::temp_filename("pdf_", "jpg");
pdf_event::movie_extract_frame($file_path, $temp_file, null, null);
list($metadata->height, $metadata->width) = photo::get_file_metadata($temp_file);
}
}
示例2: get_gs_version
/**
* Return version number of gs if found, an empty string if not.
* (ref: movie::get_ffmpeg_version())
*/
static function get_gs_version()
{
if (pdf::find_gs()) {
$path = module::get_var("pdf", "gs_path");
exec(escapeshellcmd($path) . " -version", $output);
if (stristr($output[0], "ghostscript")) {
// Found "ghostscript" in the response - it's valid.
return $output[0];
}
}
return "";
}
示例3: install
static function install()
{
// Set gs_path variable
if ($gs_path = exec("which gs")) {
module::set_var("pdf", "gs_path", $gs_path);
}
pdf::find_gs();
// Set other variables
module::set_var("pdf", "make_thumb", true);
module::set_var("pdf", "movie_overlay_hide", false);
module::set_version("pdf", 1);
}
示例4: _print_screen
private function _print_screen($form)
{
// get module parameters
$gs_path = pdf::find_gs();
$gs_dir = substr($gs_path, 0, strrpos($gs_path, "/"));
$gs_version = pdf::get_gs_version();
// make and print view
$view = new Admin_View("admin.html");
$view->page_title = t("PDF settings");
$view->content = new View("admin_pdf.html");
$view->content->form = $form;
$view->content->gs_dir = $gs_dir;
$view->content->gs_version = $gs_version;
print $view;
}