X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/c487acef42baa6abcda4506c0a14a246d20e9533..6ddc5071a71f2388b9a6b9b1f8261e591cfe66ab:/catalogue/models.py?ds=sidebyside diff --git a/catalogue/models.py b/catalogue/models.py index 4a21790..c73c762 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -239,10 +239,13 @@ class Lesson(models.Model): pdf = PdfFormat(wldoc, teacher=True).build() self.pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename()))) - def build_weasy_pdf(self): - from .publish import WeasyFormat + def build_pdf_from_html(self, **kwargs): + from .publish import PdfFromHtmlFormat wldoc = self.wldocument() - pdf = WeasyFormat(wldoc, media_root=settings.MEDIA_ROOT).build() + pdf = PdfFromHtmlFormat( + wldoc, media_root=settings.MEDIA_ROOT, + html_to_pdf_command=settings.HTML_TO_PDF_COMMAND, + **kwargs).build() self.weasy_pdf.save("%s.pdf" % self.slug, File(open(pdf.get_filename()))) def add_to_zip(self, zipf, student=False, prefix=''):