PyInvoice/test.py

26 lines
613 B
Python
Raw Normal View History

2015-05-28 10:17:55 +00:00
from reportlab.lib.units import inch
from pyinvoice.components import SimpleTable, PaidStamp
2015-05-27 17:09:44 +00:00
from pyinvoice.templates import SimpleInvoice
story = []
2015-05-28 10:17:55 +00:00
address_table = SimpleTable([
2015-05-27 17:09:44 +00:00
['Name', 'zhangshine'],
2015-05-28 10:17:55 +00:00
['City', 'Jining'],
['City', 'Jining'],
['City', 'Jining'],
['City', 'Jining'],
2015-05-27 17:09:44 +00:00
['City', 'Jining']
], horizontal_align='RIGHT')
story.append(address_table)
2015-05-28 10:17:55 +00:00
merchant_table = SimpleTable([
['Name', 'CiCiApp'],
['xxxx', 'yyyy']
], horizontal_align='LEFT')
story.append(merchant_table)
2015-05-27 17:09:44 +00:00
doc = SimpleInvoice('test.pdf')
2015-05-30 13:15:47 +00:00
doc.build(story, onFirstPage=PaidStamp(7*inch, 5.8*inch))