def apply(self, c):
"""
Apply the redaction to a canvas.
Args:
c (Canvas): canvas to apply the redaction to.
"""
page_width = c._pagesize[0]
page_height = c._pagesize[1]
c.setFont("Helvetica", 10)
c.setStrokeColorRGB(*self.style.stroke)
c.setFillColorRGB(*self.style.fill)
c.rect(*self.position+self.size, fill=1)
if self.text is not None:
c.setStrokeColorRGB(*self.style.text)
c.setFillColorRGB(*self.style.text)
c.drawCentredString(self.center[0], self.center[1], self.text)
评论列表
文章目录