当前位置: 首页>>代码示例>>PHP>>正文


PHP COM::ConvertFile方法代码示例

本文整理汇总了PHP中COM::ConvertFile方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::ConvertFile方法的具体用法?PHP COM::ConvertFile怎么用?PHP COM::ConvertFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COM的用法示例。


在下文中一共展示了COM::ConvertFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: p2fconverssion_handler

function p2fconverssion_handler($file_path, $file_name)
{
    $p2f = new COM("Print2Flash3.Server");
    if ($p2f) {
        $p2f->DefaultProfile->PageFileName = "../_sfp__" . $file_name . "/page_%page%.swf";
        $p2f->DefaultProfile->OutputFormat = 2;
        //$p2f->DefaultBatchProcessingOptions->UseAutomation=8;
        $p2fBPO = $p2f->DefaultBatchProcessingOptions;
        $p2fBPO->BeforePrintingTimeout = 900000;
        $p2fBPO->ActivityTimeout = 900000;
        $p2f->ConvertFile(realpath("../" . $file_path . "/@@-OriginalDocs-@@/" . $file_name));
        echo "Conversion is done";
    }
}
开发者ID:aview,项目名称:aview-content-php,代码行数:14,代码来源:getdocument.php

示例2: realpath

 //$p2f->DefaultProfile->PageFileName = realpath( $org_file_path ).'/_sfp__'.$file_name.'/page_%page%.swf';
 $p2f->DefaultProfile->PageFileName = realpath($org_file_path) . '\\_sfp__' . $file_name . '\\page_%page%.swf';
 try {
     $p2fBPO = $p2f->DefaultBatchProcessingOptions;
     $p2fBPO->BeforePrintingTimeout = 300000;
     $p2fBPO->ActivityTimeout = 300000;
     $p2fBPO->UseAutomation = 8;
     if ($selectArea == "PersonalArea") {
         logit("print2flash.php", "Personal area");
         $p2fBPO->CreateLogFile = true;
         $p2fBPO->LogFileName = realpath($org_file_path) . "/Log" . $file_name . ".txt";
         $logfilename = realpath($org_file_path) . "/Log" . $file_name . ".txt";
     }
     $message = "<result><status>2. Starting conversion</status><message></message></result>";
     logit("print2flash.php", $message);
     $p2f->ConvertFile($file_path);
     //$p2f->ConvertFile("C:\wamp\www\AVContent\Upload\Personal\hari\My Documents");
     /*
     //ANOTHER WAY OF EXEVCUTING P2F to run in the background, however, still failing with big files
     $p2fServerEXE = "C:\\Program Files (x86)\\Print2Flash3\\p2fServer.exe";
     $MyDocsDIR = str_replace("/", "\\", realpath($org_file_path));
     logit("print2flash.php","exec("."\"".$p2fServerEXE."\" \"".$MyDocsDIR."\\@@-OriginalDocs-@@\\".$file_name."\" \"".$MyDocsDIR."\\_sfp__".$file_name."\" /ThumbnailPageRange:All /ThumbnailImageWidth:140 /ThumbnailJpegQuality:80 /ThumbnailImageHeight:140 /ThumbnailFormat:1 /ThumbnailFileName:\"".$MyDocsDIR."\\@@-Thumbnails-@@\\".$file_name."_files\\thumbnail_%page%.%ext%\" /OutputFormat:2 /PageFileName:\"".$MyDocsDIR."\\_sfp__".$file_name."\\page_%page%.swf\"".")");
     exec("\"".$p2fServerEXE."\" \"".$MyDocsDIR."\\@@-OriginalDocs-@@\\".$file_name."\" \"".$MyDocsDIR."\\_sfp__".$file_name."\" /ThumbnailPageRange:All /ThumbnailImageWidth:140 /ThumbnailJpegQuality:80 /ThumbnailImageHeight:140 /ThumbnailFormat:1 /ThumbnailFileName:\"".$MyDocsDIR."\\@@-Thumbnails-@@\\".$file_name."_files\\thumbnail_%page%.%ext%\" /OutputFormat:2 /PageFileName:\"".$MyDocsDIR."\\_sfp__".$file_name."\\page_%page%.swf\"");
     */
     logit("print2flash.php", "3. Finished converting " . $file_path . " to " . $swffile_fs);
     $message = "<result><status>OK</status><message>{$swffile_fs}</message></result>";
 } catch (Exception $e) {
     $message = "<result><status>4. Error</status><message>" . $e->getMessage() . "</message></result>";
     logit("print2flash.php", $message);
     return $e;
 }
开发者ID:aview,项目名称:aview-content-php,代码行数:31,代码来源:print2flash.php

示例3: realpath

        $p2f->DefaultProfile->ThumbnailPageRange = "All";
        $p2f->DefaultProfile->ThumbnailImageWidth = 140;
        $p2f->DefaultProfile->ThumbnailJpegQuality = 80;
        $p2f->DefaultProfile->ThumbnailImageHeight = 140;
        $p2f->DefaultProfile->ThumbnailFormat = 1;
        $p2f->DefaultProfile->ThumbnailFileName = realpath("../../../" . $file_path) . '/@@-Thumbnails-@@/' . $file_name . '_files\\thumbnail_%page%.%ext%';
        $p2f->DefaultProfile->PageFileName = realpath("../../../" . $file_path) . '/_sfp__' . $file_name . '/page_%page%.swf';
        $p2f->DefaultBatchProcessingOptions->UseAutomation = 8;
        try {
            $p2fBPO->LoggingLevel = 1;
            $p2fBPO = $p2f->DefaultBatchProcessingOptions;
            $p2fBPO->BeforePrintingTimeout = 900000;
            $p2fBPO->ActivityTimeout = 900000;
            $p2fBPO->CreateLogFile = true;
            $p2fBPO->LogFileName = realpath("../../../" . $file_path) . "/Log" . $file_name . ".txt";
            $message = "<result><status>2. Starting conversion</status><message></message></result>";
            logit("print2flashforApi.php", $message);
            $p2f->ConvertFile($absPath);
            logit("print2flashforApi.php", "3. Finished converting " . $file_path . " to " . $swffile_fs);
            $message = "<result><status>OK</status><message>{$swffile_fs}</message></result>";
            echo "Finished Converting";
        } catch (Exception $e) {
            $message = "<result><status>4. Error</status><message>" . $e->getMessage() . "</message></result>";
            logit("print2flash.php", $message);
            return $e;
        }
    }
} else {
    $message = "<result><status>4. Error</status><message>Something is wrong with uploading a file.</message></result>";
    echo "Something is wrong with uploading a file";
}
开发者ID:aview,项目名称:aview-content-php,代码行数:31,代码来源:print2flashforApi.php

示例4: COM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php 
$fileName = "C:/wamp/www/Sample/3 MB.doc";
//$fileName="C:/wamp/www/Sample/2.pdf";
echo "Starting conversion";
$p2f = new COM("Print2Flash3.Server2");
if ($p2f) {
    //$p2f->DefaultBatchProcessingOptions->UseAutomation=8;
    $p2f->ConvertFile($fileName, "C:/wamp/www/Sample/ConvertedDoc.swf");
}
?>

</body>
</html>
开发者ID:aview,项目名称:aview-content-php,代码行数:20,代码来源:index.php


注:本文中的COM::ConvertFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。