|
|
@ -1,5 +1,6 @@
|
|
|
|
# bureau
|
|
|
|
# bureau
|
|
|
|
import functools
|
|
|
|
import functools
|
|
|
|
|
|
|
|
import glob
|
|
|
|
import inspect
|
|
|
|
import inspect
|
|
|
|
import io
|
|
|
|
import io
|
|
|
|
import json
|
|
|
|
import json
|
|
|
@ -354,6 +355,10 @@ class Bureau(object):
|
|
|
|
pdfpath = tempfile.mkstemp(".pdf")[1]
|
|
|
|
pdfpath = tempfile.mkstemp(".pdf")[1]
|
|
|
|
self.log.debug("rendering to: " + pdfpath)
|
|
|
|
self.log.debug("rendering to: " + pdfpath)
|
|
|
|
fontconfig = FontConfiguration()
|
|
|
|
fontconfig = FontConfiguration()
|
|
|
|
|
|
|
|
fontsdir = os.path.join(self.mdir, "fonts")
|
|
|
|
|
|
|
|
for font in glob.glob(fontsdir + ".otf"):
|
|
|
|
|
|
|
|
fontconfig.add_font_face("file://" + font,
|
|
|
|
|
|
|
|
weasyprint.default_url_fetcher)
|
|
|
|
weasyprint.HTML(string=templ.render_unicode(**kwargs)).write_pdf(pdfpath, font_config=fontconfig)
|
|
|
|
weasyprint.HTML(string=templ.render_unicode(**kwargs)).write_pdf(pdfpath, font_config=fontconfig)
|
|
|
|
subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " + pdfpath, shell=True)
|
|
|
|
subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " + pdfpath, shell=True)
|
|
|
|
|
|
|
|
|
|
|
|