|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
# bureau
|
|
|
|
|
import functools
|
|
|
|
|
import glob
|
|
|
|
|
import inspect
|
|
|
|
|
import io
|
|
|
|
|
import json
|
|
|
|
@ -354,6 +355,10 @@ class Bureau(object):
|
|
|
|
|
pdfpath = tempfile.mkstemp(".pdf")[1]
|
|
|
|
|
self.log.debug("rendering to: " + pdfpath)
|
|
|
|
|
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)
|
|
|
|
|
subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " + pdfpath, shell=True)
|
|
|
|
|
|
|
|
|
|