當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Folder::GetFile方法代碼示例

本文整理匯總了PHP中Folder::GetFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Folder::GetFile方法的具體用法?PHP Folder::GetFile怎麽用?PHP Folder::GetFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Folder的用法示例。


在下文中一共展示了Folder::GetFile方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DeleteChart

 public function DeleteChart($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;
         $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,代碼行數:29,代碼來源:ChartEditor.php

示例2: InsertPageNumber

 public function InsertPageNumber($fileName, $alignment, $format, $isTop, $setPageNumberOnFirstPage)
 {
     try {
         //check whether files are set or not
         if ($fileName == "") {
             throw new Exception("File not specified");
         }
         //Build JSON to post
         $fieldsArray = array('Format' => $format, 'Alignment' => $alignment, 'IsTop' => $isTop, 'SetPageNumberOnFirstPage' => $setPageNumberOnFirstPage);
         $json = json_encode($fieldsArray);
         //build URI to insert page number
         $strURI = Product::$BaseProductUri . "/words/" . $fileName . "/insertPageNumbers";
         //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,代碼來源:Field.php

示例3: 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

示例4: ReplaceText

 public function ReplaceText()
 {
     $parameters = func_get_args();
     //set parameter values
     if (count($parameters) == 3) {
         $oldText = $parameters[0];
         $newText = $parameters[1];
         $isRegularExpression = $parameters[2];
     } else {
         if (count($parameters) == 4) {
             $oldText = $parameters[0];
             $newText = $parameters[1];
             $isRegularExpression = $parameters[2];
             $pageNumber = $parameters[3];
         } 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 JSON to post
         $fieldsArray = array('OldValue' => $oldText, 'NewValue' => $newText, 'Regex' => $isRegularExpression);
         $json = json_encode($fieldsArray);
         //Build URI to replace text
         $strURI = Product::$BaseProductUri . "/slides/" . $this->FileName . (isset($parameters[3]) ? "/pages/" . $pageNumber : "") . "/replaceText";
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "json", $json);
         $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,代碼行數:45,代碼來源:TextEditor.php

示例5: 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

示例6: 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

示例7: ExecuteTemplate

 public function ExecuteTemplate($fileName, $strXML)
 {
     try {
         //check whether files are set or not
         if ($fileName == "") {
             throw new Exception("File not specified");
         }
         //build URI to execute mail merge template
         $strURI = Product::$BaseProductUri . "/words/" . $fileName . "/executeTemplate";
         //sign URI
         $signedURI = Utils::Sign($strURI);
         $responseStream = Utils::processCommand($signedURI, "POST", "", $strXML);
         $v_output = Utils::ValidateOutput($responseStream);
         if ($v_output === "") {
             $json = json_decode($responseStream);
             //Save docs on server
             $folder = new Folder();
             $outputStream = $folder->GetFile($json->Document->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,代碼行數:28,代碼來源:MailMerge.php


注:本文中的Folder::GetFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。