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
)
评论列表
文章目录