日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

php ppt转换成图片格式,帮忙看下,这个程序实现使用office的COM组件将ppt转换为图片...

發布時間:2025/4/5 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php ppt转换成图片格式,帮忙看下,这个程序实现使用office的COM组件将ppt转换为图片... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

本人比較菜,看不出來為什么,只支持office2003或者是office2007.請問如何能改為更高版本的嗎,因為這兩個版本只有32位的,在64位系統下調用不到COM組件。

/*********************/

/* */

/* Dezend for PHP5 */

/* NWS */

/* Nulled.WS */

/* */

/*********************/

$debug = true;

header( "Content-Type:text/xml;charset=UTF-8" );

header( "Cache-Control: no-store, no-cache, must-revalidate" );

header( "Cache-Control: post-check=0, pre-check=0", false );

require_once( "../inc/inc.php" );

$uploadFileName = $_FILES[*Filedata*][*name*];

$uploadFile = $_FILES[*Filedata*][*tmp_name*];

$localFormat = getFileExt( $uploadFileName );

$is_allowed_upload = true;

$forbbidenFileType = array( "php", "sh", "exe", "bat" );

putlog( "1: ".api_get_path( SYS_PATH ));

foreach ( $forbbidenFileType as $value )

{

if ( strtolower( $localFormat ) == $value )

{

$is_allowed_upload = false;

break;

break;

}

}

if ( strtolower( $localFormat ) != "ppt" )

{

$is_allowed_upload = false;

}

if ( $is_allowed_upload && is_uploaded_file( $uploadFile ) )

{

$extendType = getFileExt( $uploadFileName );

$localFileName = trim( $_GET[*fileName*] );

$localFile = api_get_path( SYS_PATH )."meeting/pptUpload/".$localFileName;

if ( move_uploaded_file( $uploadFile, $localFile ) )

{

$pos = strrpos( $localFileName, "." );

$len = strlen( $uploadFileName );

$folder = substr( $localFileName, 0, $pos );

$create_date = date( "Y-m-d h:i:s" );

if ( !( $ppt = new COM( "powerpoint.application" ) ) )

{

exit( "Unable to Open MSPowerPoint" );

}

putlog( "斷點1 ".$localFile ." ..");

$ppt->Visible = true;

putlog( "斷點2 " );

$ppt->Presentations->Open( realpath( $localFile ) );

putlog( "斷點3 " );

$pptCount = $ppt->activePresentation->Slides->Count;

$export_folder = api_get_path( SYS_PATH )."meeting/pptUpload/".$folder;

if ( !file_exists( $export_folder ) )

{

mkdir( $export_folder, 511 );

}

$ppt->activePresentation->Export( $export_folder, "JPG", 640, 480 );

$ppt->Quit( );

$sql = "insert into attachment (file_name,local_file_name,meet_no,file_size,file_type,created_time,model_type) values (*".$uploadFileName."*,*".$folder."*,*". trim( $_GET[*roomID*] )."*,*".$pptCount."*,*".$extendType."*,NOW(),*PRESENTATION*)";

$rs = api_sql_query( $sql, __FILE__, 61 );

if ( !$rs && $debug )

{ putlog("insert zlchat pptFile -".$uploadFileName." ERROR!");

error_log( "insert zlchat pptFile -".$uploadFileName." ERROR!", 0 );

}else

putlog($sql);

$path2 = api_get_path( SYS_PATH )."meeting/pptUpload/".$folder."/";

$handle = opendir( $path2 );

while ( $file = readdir( $handle ) )

{

if ( !is_dir( $file ) )

{

preg_match_all( "/(\\d+)\\.JPG$/", $file, $name_arr );

$newName = $name_arr[0][0];

rename( $path2.$file, $path2.$newName );

}

}

closedir( $handle );

}

else

{

if ( $debug )

{

error_log( "upload zlchat pptFile -".$uploadFileName." ERROR!", 0 );

}

}

}

?>

總結

以上是生活随笔為你收集整理的php ppt转换成图片格式,帮忙看下,这个程序实现使用office的COM组件将ppt转换为图片...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。