- doc.append(texml_cmd("thispagestyle", "empty"))
-
- # title page
- height_left = 297
- cover_url = self.doc.meta.get_one(DCNS('relation.coverimage.url'))
- if cover_url:
- self.add_file(build_ctx, 'cover.png', cover_url, image=True)
-
- img = Image.open(self.get_file(build_ctx, 'cover.png'))
- size = img.size
-
- if size[1] > size[0]:
- img = img.crop((0, 0, size[0], size[0]))
- img.save(self.get_file(build_ctx, 'cover.png'), format=img.format, quality=90)
- size = img.size
-
- # TODO: hardcoded paper size here
- height = 210.0 * size[1] / size[0]
- doc.append(texml_cmd("makecover", "%fmm" % height))
- else:
- doc.append(texml_cmd("vfill*"))