/** * Convert PDF to different file format without using storage * $param string $inputFile * @param string $outputfileName * @param string $outputFormat */ public function convertLocalFile($inputFile = "", $outputfileName = "", $outputFormat = "") { try { //check whether file is set or not if (empty($inputFile)) { throw new Exception("No file name specified"); } if (empty($outputFormat)) { throw new Exception("output format not specified"); } $strURI = Product::$baseProductUri . "/pdf/convert?format=" . $outputFormat; if (!file_exists($inputFile)) { throw new Exception("input file doesn't exist."); } $signedURI = Utils::sign($strURI); $responseStream = Utils::uploadFileBinary($signedURI, $inputFile, "xml"); $v_output = Utils::ValidateOutput($responseStream); if ($v_output === "") { if ($outputFormat == "html") { $save_format = "zip"; } else { $save_format = $outputFormat; } if ($outputfileName == "") { $outputfileName = Utils::getFileName($inputFile) . "." . $save_format; } Utils::saveFile($responseStream, SaasposeApp::$outputLocation . $outputfileName); return ""; } else { return $v_output; } } catch (Exception $e) { throw new Exception($e->getMessage()); } }