+
+ return Response::create(
+ $content,
+ 200,
+ [
+ 'Content-type' => 'text/plain',
+ 'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"',
+ 'Content-Transfer-Encoding' => 'UTF-8',
+ ]
+ );
+ }
+
+ /**
+ * Return a Serializer object for producing processes that need it (JSON & XML).
+ *
+ * @param string $format
+ *
+ * @return Serializer
+ */
+ private function prepareSerializingContent($format)
+ {
+ $serializer = SerializerBuilder::create()->build();
+
+ return $serializer->serialize(
+ $this->entries,
+ $format,
+ SerializationContext::create()->setGroups(['entries_for_user'])
+ );
+ }
+
+ /**
+ * Return a kind of footer / information for the epub.
+ *
+ * @param string $type Generator of the export, can be: tdpdf, PHPePub, PHPMobi
+ *
+ * @return string
+ */
+ private function getExportInformation($type)
+ {
+ $info = str_replace('%EXPORT_METHOD%', $type, $this->footerTemplate);
+
+ if ('tcpdf' === $type) {
+ return str_replace('%IMAGE%', '<img src="'.$this->logoPath.'" />', $info);
+ }
+
+ return str_replace('%IMAGE%', '', $info);