从html内容创建漂亮的pdf报告。
pdf_reports的Python项目详细描述
pdf reports(完整文档here)是一个python库,用于从html或Pug模板创建漂亮的pdf报告。它具有外观现代的组件(通过Semantic UI框架),并提供了在文档中嵌入表或图的例程。
使用示例
您的pug模板文件template.pug可能如下所示(请参见afull example):
#sidebar I am the text in the sidebar. h1 {{ title }} .ui.piled.segmentp Oh hi there ! I am some text in a cool box.
您的python代码如下:
frompdf_reportsimportpug_to_html,write_reporthtml=pug_to_html("template.pug",title="My report")write_report(html,"example.pdf")
最后的结果可能是这样的(PDF file):
信息
pip安装:
pip install pdf_reports
web文档:
https://edinburgh-genome-foundry.github.io/pdf_reports/
github页
https://github.com/Edinburgh-Genome-Foundry/pdf_reports
现场演示
http://cuba.genomefoundry.org/sculpt_a_sequence
许可证:麻省理工学院,爱丁堡基因组铸造厂版权所有