/** * @param $documentId * @throws \Exception */ public function cancelGeneration($documentId) { $document = Document\Printpage::getById($documentId); if (empty($document)) { throw new \Exception("Document with id " . $documentId . " not found."); } Model\Tool\Lock::release($document->getLockKey()); Model\Tool\TmpStore::delete($document->getLockKey()); }
public function startPdfGenerationAction() { $document = Document\Printpage::getById(intval($this->getParam("id"))); if (empty($document)) { throw new \Exception("Document with id " . $this->getParam("id") . " not found."); } $document->generatePdf($this->getAllParams()); $this->saveProcessingOptions($document->getId(), $this->getAllParams()); $this->_helper->json(["success" => true]); }