pdf_form_display.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:intake 作者: codeforamerica 项目源码 文件源码
def draw_letter(self):
        max_width = u('6.5in')
        max_height = self.height - (
            self.frame.top + self.frame.bottom)
        self.set_cursor(u('1in'), self.height - self.frame.top)
        dx, dy = self.draw_paragraph(
            self.nice_date, max_width, max_height, BODY_STYLE)
        self.move_cursor(0, -(dy + self.field_bottom_margin))
        dx, dy = self.draw_paragraph(
            "To Whom It May Concern,", max_width, max_height, BODY_STYLE)
        self.move_cursor(0, -(dy + self.field_bottom_margin))
        for field in self.keys_to_fields(self.letter_display_fields, 'letter'):
            dx, dy = self.draw_paragraph(
                field.get_display_value(), max_width, max_height, BODY_STYLE)
            self.move_cursor(0, -(dy + self.field_bottom_margin))
        dx, dy = self.draw_paragraph(
            "Sincerely,", max_width, max_height, BODY_STYLE)
        self.move_cursor(0, -(dy + self.field_bottom_margin))
        full_name = " ".join([
            self.form.first_name.get_display_value(),
            self.form.last_name.get_display_value()
        ])
        dx, dy = self.draw_paragraph(
            full_name, max_width, max_height, BODY_STYLE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号