+
+ /**
+ * Export a page to a simple plaintext .txt file.
+ * @param $bookSlug
+ * @param $pageSlug
+ * @return \Illuminate\Http\Response
+ */
+ public function exportPlainText($bookSlug, $pageSlug)
+ {
+ $book = $this->bookRepo->getBySlug($bookSlug);
+ $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
+ $containedHtml = $this->exportService->pageToPlainText($page);
+ return response()->make($containedHtml, 200, [
+ 'Content-Type' => 'application/octet-stream',
+ 'Content-Disposition' => 'attachment; filename="'.$pageSlug.'.txt'
+ ]);
+ }
+