如何生成和打印文档(python)
我需要允许用户编辑和打印与客户相关的文档(发票和其他) 用户填写打印表单(选择客户、月份、他/她需要的4种类型的文档的副本数量),然后单击“打印”按钮 接下来,我的系统应该做(算法): 要求:如何生成和打印文档(python),python,printing,Python,Printing,我需要允许用户编辑和打印与客户相关的文档(发票和其他) 用户填写打印表单(选择客户、月份、他/她需要的4种类型的文档的副本数量),然后单击“打印”按钮 接下来,我的系统应该做(算法): 要求: 编辑结果的能力(需要word frindly格式) 分页符(新页面上的每个文档) 表格不是很简单,请看发票第三方物流示例: 字体大小和样式(例如,粗体) 保存文本位置 我的问题是如何生成此文件(结果)? 有一个项目,但不确定它是否可以与模板一起工作(或者至少根据需要生成表)。。。 或者我可以将我所有
- 编辑结果的能力(需要word frindly格式)
- 分页符(新页面上的每个文档)
- 表格不是很简单,请看发票第三方物流示例:
- 字体大小和样式(例如,粗体)
- 保存文本位置
p、 更好地使用python,但它并不重要,我可以使用java/perl/ruby/php/bash/等等。。并安装任何与Ubuntu兼容的新软件包…如果不一定需要使用模板,或者如果您愿意用代码重新创建模板,请使用python生成PDF,然后打印它 有关如何生成表,请参见此示例: 另请查看此发票示例:
以后是否可以手动编辑此pdf报告?(例如,更改此表中的值)
result = create new word-friendly file # because user may manually edit it later
for client in form_clients:
snapshot = select row in snapshots table
where client == client and month == form_month
document1 = generate_from_template(snapshot, tpl1.docx)
for 1 to form_how_much_copies_of_1_type_of_document_he_or_she_needs:
result += document1
document2 = generate_from_template(snapshot, tpl2.docx)
for 1 to form_how_much_copies_of_2_type_of_document_he_or_she_needs:
result += document2
document3 = generate_from_template(snapshot, tpl3.docx)
for 1 to form_how_much_copies_of_3_type_of_document_he_or_she_needs:
result += document3
document4 = generate_from_template(snapshot, tpl4.docx)
for 1 to form_how_much_copies_of_4_type_of_document_he_or_she_needs:
result += document4
print result