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());
}