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


PHP Utils::processCommand方法代码示例

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


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

示例1: Convert

 public function Convert()
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         $strURI = Product::$BaseProductUri . "/pdf/" . $this->FileName . "?format=" . $this->saveformat;
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             if ($this->saveformat == "html") {
                 $save_format = "zip";
             } else {
                 $save_format = $this->saveformat;
             }
             Utils::saveFile($responseStream, SaasposeApp::$OutPutLocation . Utils::getFileName($this->FileName) . "." . $save_format);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:26,代码来源:Converter.php

示例2: getMailMergeFieldNames

 /**
  * Gets all merge filed names from document.
  * @param string $fileName
  */
 public function getMailMergeFieldNames()
 {
     try {
         $strURI = Product::$baseProductUri . "/words/" . $this->fileName . "/mailMergeFieldNames";
         $signedURI = Utils::sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $json = json_decode($responseStream);
         return $json->FieldNames->List;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:rvanlaak,项目名称:Saaspose.SDK-for-PHP,代码行数:16,代码来源:Field.php

示例3: GetMailMergeFieldNames

 public function GetMailMergeFieldNames($fileName)
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         $strURI = Product::$BaseProductUri . "/words/" . $this->FileName . "/mailMergeFieldNames";
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $json = json_decode($responseStream);
         return $json->FieldNames->List;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:16,代码来源:Field.php

示例4: Save

 public function Save($codeText, $symbology, $imageFormat, $xResolution, $yResolution, $xDimension, $yDimension)
 {
     //build URI to generate barcode
     $strURI = Product::$BaseProductUri . "/barcode/generate?text=" . $codeText . "&type=" . $symbology . "&format=" . $imageFormat . ($xResolution <= 0 ? "" : "&resolutionX=" . $xResolution) . ($yResolution <= 0 ? "" : "&resolutionY=" . $yResolution) . ($xDimension <= 0 ? "" : "&dimensionX=" . $xDimension) . ($yDimension <= 0 ? "" : "&dimensionY=" . $yDimension);
     try {
         //sign URI
         $signedURI = Utils::Sign($strURI);
         //get response stream
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         //Save output barcode image
         $outputPath = SaasposeApp::$OutPutLocation . "barcode" . $symbology . "." . $imageFormat;
         Utils::saveFile($responseStream, $outputPath);
         return $outputPath;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:17,代码来源:BarCodeBuilder.php

示例5: Read

 public function Read($symbology)
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         //build URI to read barcode
         $strURI = Product::$BaseProductUri . "/barcode/" . $this->FileName . "/recognize?" . (!isset($symbology) || trim($symbology) === '' ? "type=" : "type=" . $symbology);
         //sign URI
         $signedURI = Utils::Sign($strURI);
         //get response stream
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $json = json_decode($responseStream);
         //returns a list of extracted barcodes
         return $json->Barcodes;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:20,代码来源:BarCodeReader.php

示例6: GetImageCustomSize

 public function GetImageCustomSize($pageNumber, $imageIndex, $imageFormat, $imageWidth, $imageHeight)
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         $strURI = Product::$BaseProductUri . "/pdf/" . $this->FileName . "/pages/" . $pageNumber . "/images/" . $imageIndex . "?format=" . $imageFormat . "&width=" . $imageWidth . "&height=" . $imageHeight;
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             Utils::saveFile($responseStream, SaasposeApp::$OutPutLocation . Utils::getFileName($this->FileName) . "_" . $imageIndex . "." . $imageFormat);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:21,代码来源:Extractor.php

示例7: AppendDocument

 public function AppendDocument($appendDocs, $importFormatModes, $sourceFolder)
 {
     try {
         //check whether files are set or not
         if ($this->FileName == "") {
             throw new Exception("Base file not specified");
         }
         //check whether required information is complete
         if (count($appendDocs) != count($importFormatModes)) {
             throw new Exception("Please specify complete documents and import format modes");
         }
         //Build JSON to post
         $json = '{ "DocumentEntries": [';
         for ($i = 0; $i < count($appendDocs); $i++) {
             $json .= '{ "Href": "' . $sourceFolder . $appendDocs[$i] . '", "ImportFormatMode": "' . $importFormatModes[$i] . '" }' . ($i < count($appendDocs) - 1 ? ',' : '');
         }
         $json .= '  ] }';
         //build URI to merge Docs
         $strURI = Product::$BaseProductUri . "/words/" . $this->FileName . "/appendDocument";
         //sign URI
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "json", $json);
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save merged docs on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($sourceFolder . ($sourceFolder == '' ? '' : '/') . $this->FileName);
             $outputPath = SaasposeApp::$OutPutLocation . $this->FileName;
             Utils::saveFile($outputStream, $outputPath);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:37,代码来源:Document.php

示例8: AutoShapeToImage

 public function AutoShapeToImage($shapeIndex, $imageFormat)
 {
     try {
         //check whether file and sheet is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         if ($this->WorksheetName == "") {
             throw new Exception("No worksheet specified");
         }
         //Build URI
         $strURI = Product::$BaseProductUri . "/cells/" . $this->FileName . "/worksheets/" . $this->WorksheetName . "/autoshapes/" . $shapeIndex . "?format=" . $imageFormat;
         //Sign URI
         $signedURI = Utils::Sign($strURI);
         //Send request and receive response stream
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         //Validate output
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save ouput file
             $outputPath = SaasposeApp::$OutPutLocation . Utils::getFileName($this->FileName) . "_" . $this->WorksheetName . "." . $imageFormat;
             Utils::saveFile($responseStream, $outputPath);
             return $outputPath;
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:30,代码来源:Converter.php

示例9: getDefaultStyle

 /**
  * Get Default Style
  */
 public function getDefaultStyle()
 {
     try {
         //build URI to merge Docs
         $strURI = Product::$baseProductUri . "/cells/" . $this->fileName . "/defaultStyle";
         //sign URI
         $signedURI = Utils::sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET");
         $json = json_decode($responseStream);
         return count($json->Names);
         // FIXME this count seems wrong
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:rvanlaak,项目名称:Saaspose.SDK-for-PHP,代码行数:18,代码来源:Workbook.php

示例10: GetFilesList

 public function GetFilesList($strFolder)
 {
     try {
         //build URI
         $strURI = $this->strURIFolder;
         //check whether file is set or not
         if (!$strFolder == "") {
             $strURI .= $strFolder;
         }
         //sign URI
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $json = json_decode($responseStream);
         return $json->Files;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:18,代码来源:Folder.php

示例11: DeleteAllSlides

 public function DeleteAllSlides()
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         //Build URI to replace text
         $strURI = Product::$BaseProductUri . "/slides/" . $this->FileName . "/slides";
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "DELETE", "", "");
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save doc on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($this->FileName);
             $outputPath = SaasposeApp::$OutPutLocation . $this->FileName;
             Utils::saveFile($outputStream, $outputPath);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:26,代码来源:Document.php

示例12: GetBorder

 public function GetBorder($chartIndex)
 {
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         //check whether workshett name is set or not
         if ($this->WorksheetName == "") {
             throw new Exception("Worksheet name not specified");
         }
         $strURI = Product::$BaseProductUri . "/cells/" . $this->FileName . "/worksheets/" . $this->WorksheetName . "/charts/" . $chartIndex . "/chartArea/border";
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "GET", "", "");
         $json = json_decode($responseStream);
         return $json->Line;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:20,代码来源:ChartEditor.php

示例13: ReplaceText

 public function ReplaceText()
 {
     $parameters = func_get_args();
     //set parameter values
     if (count($parameters) == 2) {
         $oldText = $parameters[0];
         $newText = $parameters[1];
     } else {
         if (count($parameters) == 3) {
             $oldText = $parameters[1];
             $newText = $parameters[2];
             $worksheetName = $parameters[0];
         } else {
             throw new Exception("Invalid number of arguments");
         }
     }
     try {
         //check whether file is set or not
         if ($this->FileName == "") {
             throw new Exception("No file name specified");
         }
         //Build URI to replace text
         $strURI = Product::$BaseProductUri . "/cells/" . $this->FileName . (count($parameters) == 3 ? "/worksheets/" . $worksheetName : "") . "/replaceText?oldValue=" . $oldText . "&newValue=" . $newText;
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "", "");
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save doc on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($this->FileName);
             $outputPath = SaasposeApp::$OutPutLocation . $this->FileName;
             Utils::saveFile($outputStream, $outputPath);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:40,代码来源:TextEditor.php

示例14: ReplaceImageUsingFile

 public function ReplaceImageUsingFile($pageNumber, $imageIndex, $fileName)
 {
     try {
         //check whether files are set or not
         if ($this->FileName == "") {
             throw new Exception("PDF file name not specified");
         }
         //build URI to replace image
         $strURI = Product::$BaseProductUri . "/pdf/" . $this->FileName . "/pages/" . $pageNumber . "/images/" . $imageIndex . "?imageFile=" . $fileName;
         //sign URI
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "", "");
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save PDF file on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($this->FileName);
             $outputPath = SaasposeApp::$OutPutLocation . $this->FileName;
             Utils::saveFile($outputStream, $outputPath);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:27,代码来源:Document.php

示例15: ReplaceText

 public function ReplaceText($fileName, $oldValue, $newValue, $isMatchCase, $isMatchWholeWord)
 {
     try {
         //check whether files are set or not
         if ($fileName == "") {
             throw new Exception("File not specified");
         }
         //Build JSON to post
         $fieldsArray = array('OldValue' => $oldValue, 'NewValue' => $newValue, 'IsMatchCase' => $isMatchCase, 'IsMatchWholeWord' => $isMatchWholeWord);
         $json = json_encode($fieldsArray);
         //build URI to replace text
         $strURI = Product::$BaseProductUri . "/words/" . $fileName . "/replaceText";
         //sign URI
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "json", $json);
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             //Save docs on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($fileName);
             $outputPath = SaasposeApp::$OutPutLocation . $fileName;
             Utils::saveFile($outputStream, $outputPath);
             return "";
         } else {
             return $v_output;
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:nishantcbse,项目名称:Saaspose.SDK-for-PHP,代码行数:30,代码来源:DocumentBuilder.php


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