|
@@ -20,7 +20,7 @@ $GLOBALS["ffmpeg"] = $ffmpeg;
|
|
|
|
|
|
|
|
$root = '../../assets/API/Universal';
|
|
$root = '../../assets/API/Universal';
|
|
|
//$root = '../../上傳測試/Revit';
|
|
//$root = '../../上傳測試/Revit';
|
|
|
-$folder = 'Revit/托放元件';
|
|
|
|
|
|
|
+$folder = 'Revit/拖放元件';
|
|
|
|
|
|
|
|
if (isset($_POST["APIName"])) {
|
|
if (isset($_POST["APIName"])) {
|
|
|
$folder = $APIName;
|
|
$folder = $APIName;
|
|
@@ -58,33 +58,6 @@ function ConvertVideo($file_path, $ffmpeg)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function ConvertPdf($file_path)
|
|
|
|
|
-{
|
|
|
|
|
- $dir_name = pathinfo($file_path, PATHINFO_DIRNAME);
|
|
|
|
|
- $file_name = pathinfo($file_path, PATHINFO_FILENAME);
|
|
|
|
|
- $ext = pathinfo($file_path, PATHINFO_EXTENSION);
|
|
|
|
|
- if (!file_exists("../." . $dir_name . '/' . $file_name . ".pdf")) {
|
|
|
|
|
- $converter = new OfficeConverter("../." . $file_path, "./", "soffice.bin ", false);
|
|
|
|
|
- $converter->convertTo("../." . $dir_name . '/' . $file_name . ".pdf");
|
|
|
|
|
- $GLOBALS["output"] .= "<span style='color:red;'>";
|
|
|
|
|
- $GLOBALS["output"] .= " " . $ext . " ==> pdf";
|
|
|
|
|
- $GLOBALS["output"] .= "</span>";
|
|
|
|
|
- }
|
|
|
|
|
- if (!file_exists("../." . $dir_name . '/' . $file_name . ".jpg")) {
|
|
|
|
|
- $root = $_SERVER['DOCUMENT_ROOT'] . '/BIM-Monitor' . substr($dir_name, 1) . '/' . $file_name;
|
|
|
|
|
-
|
|
|
|
|
- $im = new imagick();
|
|
|
|
|
- $im->readimage($root . '.pdf[0]');
|
|
|
|
|
- $im->setImageFormat('jpg');
|
|
|
|
|
- $im->writeImage($root . '.jpg');
|
|
|
|
|
- $im->clear();
|
|
|
|
|
- $im->destroy();
|
|
|
|
|
- $GLOBALS["output"] .= "<span style='color:red;'>";
|
|
|
|
|
- $GLOBALS["output"] .= " pdf ==> jpg";
|
|
|
|
|
- $GLOBALS["output"] .= "</span>";
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
function FindPath($root, $folder, $ffmpeg)
|
|
function FindPath($root, $folder, $ffmpeg)
|
|
|
{
|
|
{
|