Creating ODT
The goal of this library is to help you out with basic tasks. You can easily generate ODT files with 100 pages (paper size is A4), having a little text on each.
If you don’t like how ODT files are generated by this library, you can check the faker-file package, which can produce complex ODT documents.
If you need bytes
from fake import FAKER
odt_bytes = FAKER.odt()
See the full example
here
The generated ODT will consist of a single page with little text on it.
If you want to control number of pages created, you could:
Pass the list of texts to be used in
textsargument.Pass the number of pages to be created in
nb_pagesargument.
See the example below for texts tweak:
texts = FAKER.sentences()
odt_bytes = FAKER.odt(texts=texts)
See the full example
here
See the example below for nb_pages tweak:
odt_bytes = FAKER.odt(nb_pages=100)
See the full example
here
If you need files
odt_file = FAKER.odt_file()
See the full example
here
With texts tweak:
texts = FAKER.sentences()
odt_file = FAKER.odt_file(texts=texts)
See the full example
here
With nb_pages tweak:
odt_file = FAKER.odt_file(nb_pages=100)
See the full example
here