pdf.py 文件源码

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

项目:sff 作者: nevarezs 项目源码 文件源码
def create_document_from_row_list(title, header, row_list,
    file_path, is_landscape = False):
    """Create and save PDF document from a table.

    Args:
      title: The title that will be used on the first page of the document.
      row_list: List of rows containing the data
      file_path: full path of the pdf document to save
    """
    options = {
        'page-size': 'Letter',
        'encoding': "UTF-8"
    }
    if (is_landscape):
        options["orientation"] = 'Landscape'
    pdfkit.from_string(
        html.generate_document_from_row_list(
            title, header, row_list).encode('unicode-escape'),
        file_path,
        options
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号