+
+ /**
+ * Export a book to a contained ZIP export file.
+ * @throws NotFoundException
+ */
+ public function zip(string $bookSlug, string $chapterSlug, ZipExportBuilder $builder)
+ {
+ $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug);
+ $zip = $builder->buildForChapter($chapter);
+
+ return $this->download()->streamedFileDirectly($zip, $chapterSlug . '.zip', true);
+ }