images in PDF
authorJan Szejko <j-sz@o2.pl>
Mon, 14 Mar 2016 16:54:31 +0000 (17:54 +0100)
committerJan Szejko <j-sz@o2.pl>
Mon, 14 Mar 2016 16:54:31 +0000 (17:54 +0100)
apps/catalogue/views.py

index af2efe2..d93a8c4 100644 (file)
@@ -259,7 +259,7 @@ def book_pdf(request, slug):
     # TODO: move to celery
     doc = book.wldocument()
     # TODO: error handling
-    pdf_file = doc.as_pdf()
+    pdf_file = doc.as_pdf(cover=True, ilustr_path=os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, book.gallery))
     from catalogue.ebook_utils import serve_file
     return serve_file(pdf_file.get_filename(),
                 book.slug + '.pdf', 'application/pdf')