+ def build_pdf_from_html(self, **kwargs):
+ from .publish import PdfFromHtmlFormat
+ wldoc = self.wldocument()
+ 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())))
+