def fits(self, flowables):
story = flowables
self.resize_images(story)
W, H = (
self.width - self.lm - self.rm), self.height - self.tm - self.bm
canv = Canvas(io.StringIO(), (W, H))
total_height = sum([el.wrapOn(canv, W, 0)[1] + bt.spaceBefore
for el in story])
if getattr(self, "verbose", False) == True:
print("***", total_height / mm, H / mm, \
[txt.text[:5] for txt in story])
return total_height < H
评论列表
文章目录