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-28 10:17:55 +00:00
|
|
|
doc.build(story, onFirstPage=PaidStamp(inch, 10*inch))
|