ISBN in html reader
[wolnelektury.git] / src / catalogue / views.py
index 44a17b4..503b6f5 100644 (file)
@@ -628,6 +628,7 @@ class CustomPDFFormView(AjaxableFormView):
     form_class = forms.CustomPDFForm
     title = ugettext_lazy('Download custom PDF')
     submit = ugettext_lazy('Download')
     form_class = forms.CustomPDFForm
     title = ugettext_lazy('Download custom PDF')
     submit = ugettext_lazy('Download')
+    template = 'catalogue/custom_pdf_form.html'
     honeypot = True
 
     def __call__(self, *args, **kwargs):
     honeypot = True
 
     def __call__(self, *args, **kwargs):
@@ -784,3 +785,12 @@ def collections(request):
         'objects': objects,
         'best': best,
     })
         'objects': objects,
         'best': best,
     })
+
+
+def ridero_cover(request, slug):
+    from librarian.cover import DefaultEbookCover
+    wldoc = Book.objects.get(slug=slug).wldocument()
+    cover = DefaultEbookCover(wldoc.book_info, width=980, bleed=20, format='PNG')
+    response = HttpResponse(content_type="image/png")
+    cover.save(response)
+    return response