isConfirmed()) { $this->addFlash('warning', 'Ein PDF kann nur für bestätigte Buchungen erstellt werden.'); return $this->redirectToRoute('app_admin_accommodationbooking_show', ['id' => $booking->getId()]); } try { return $this->pdfGenerator->createDownloadResponse($booking); } catch (\RuntimeException $e) { $this->addFlash('warning', 'Das PDF konnte nicht erstellt werden: '.$e->getMessage()); return $this->redirectToRoute('app_admin_accommodationbooking_show', ['id' => $booking->getId()]); } } }