根据西班牙法规创建pdf发票。
facturapdf的Python项目详细描述
根据西班牙法规创建pdf发票。
用法
检查tests/tests_functional.py和facturapdf/strategies文件。
发电机
为了简化pdf流的创建,可以使用生成器函数。
元素生成器
基于给定字符串创建可流动的。检查元素功能 查看可用元素。参数在由管道()分隔的方括号内给出。
# Generates a Image flowable with 25 mm of widthgenerators.element('image[logo.jpg|25]')# Generates a FrameBreak flowablegenerators.element('framebreak')
章节生成器
创建传递任意数量字符串参数的可流动性列表。
generators.chapter('Paragraph[Cat in the hat]','image[hat.jpg|25]')# Passing a string that is not a valid flowable keyword or anything that is not a string will do nothing# So you can mix chapter generator with another one at oncegenerators.chapter('hello',[1,2,3])# will return ['hello', [1, 2, 3]]
测试
$ python -m unittest discover
检查tests/output文件夹中的输出文件
更改日志
- 0.0.4(2015-02-03)
- 将ReportLab版本升级到3.1.44以修复枕头问题
- 修复python 3
- 测试基础设施的几个改进:添加tox和travis CI
许可证
BSD 3条款许可证。请参阅许可证文件。