First draft for image support.
This commit is contained in:
parent
75015dd248
commit
d285ef7390
4 changed files with 156 additions and 14 deletions
15
samples/images/render.py
Normal file
15
samples/images/render.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# /usr/bin/activate
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../..')))
|
||||
|
||||
from secretary import Renderer
|
||||
|
||||
if __name__ == '__main__':
|
||||
engine = Renderer(media_path='.')
|
||||
template = open('template.odt', 'rb')
|
||||
output = open('output.odt', 'wb')
|
||||
|
||||
output.write(engine.render(template, image='writer.png'))
|
||||
print("Template rendering finished! Check output.odt file.")
|
||||
BIN
samples/images/template.odt
Normal file
BIN
samples/images/template.odt
Normal file
Binary file not shown.
BIN
samples/images/writer.png
Normal file
BIN
samples/images/writer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
Loading…
Add table
Add a link
Reference in a new issue