/** * Gets the document path and calls the conversion function * * @return boolean */ public function processDocument() { $oStorage = KTStorageManagerUtil::getSingleton(); $path = $oStorage->temporaryFile($this->document); $ext = KTMime::getFileType($this->document->getMimeTypeID()); if (!file_exists($path)) { global $default; $default->log->debug('PDF Converter: Document, id: ' . $this->document->iId . ', does not exist at given storage path: ' . $path); return sprintf(_kt("The document, id: %s, does not exist at the given storage path: %s"), $this->document->iId, $path); } // check for OO $available = $this->checkOO(); // do pdf conversion if (!$available) { global $default; $default->log->error("PDF Converter: Cannot connect to Open Office Server on host {$this->ooHost} : {$this->ooPort}"); return _kt('Cannot connect to Open Office Server.'); } $res = $this->convertFile($path, $ext); if ($res !== true) { global $default; $default->log->debug('PDF Converter: Document, id: ' . $this->document->iId . ', could not be converted to pdf.'); return sprintf(_kt("The document, id: %s, could not be converted to pdf format. The following error occurred: \"%s\"."), $this->document->iId, $res); } return true; }
/** * Gets the document path and calls the conversion function * * @return boolean */ public function processDocument() { $oStorage = KTStorageManagerUtil::getSingleton(); $path = $oStorage->temporaryFile($this->document); $ext = KTMime::getFileType($this->document->getMimeTypeID()); if (!file_exists($path)) { global $default; $default->log->debug('Document, id: ' . $this->document->iId . ', does not exist at given storage path: ' . $path); return false; } // do pdf conversion $res = $this->convertFile($path, $ext); if ($res === false) { global $default; $default->log->debug('Document, id: ' . $this->document->iId . ', could not be converted to pdf.'); return false; } return true; }