-
Couldn't load subscription status.
- Fork 6
Embed dialog in ODF document
sasa edited this page Apr 14, 2017
·
9 revisions
Convert dialog file .xdlto python code and embed in LibreOffice document
-
Prepare
- create dialog in Dialog Editor
- create project directory in
LIBREOFFICE_PATH/4/user/Scripts/python/ - place ODF document eg.
Text document.odtin project dir.(tested with.odt,.ods,.odpand.odg). - copy
config.iniin project directory and edit section to customize behavior (optional)
-
Write code
-
run
unoditwith parameterembed_convertuse parameter
-fto set the path to any local directory withxdlfile.python3 ./unodit.py -m 'embed_convert' -d 'LIBREOFFICE_PATH/4/user/Scripts/python/TestLib' -f 'LIBREOFFICE_PATH/4/user/basic/DialogLib/Default.xdl' -a 'Test_embed' -
write your code in generated file
Test_embed.py
-
-
Pack macro in document
-
run
unoditwith parameterembed_packpython3 ./unodit.py -m 'embed_convert' -d 'LIBREOFFICE_PATH/4/user/Scripts/python/TestLib' -f 'LIBREOFFICE_PATH/4/user/basic/DialogLib/Default.xdl' -a 'Test_embed'
-
Available options for parameter -m: 'embed_convert', 'embed_pack', 'embed_all'
'embed_all' = all in one, use for testing
TestLib/
Text document.odt
src/ embed_convert
Test_embed.py --------------
Text document_MACRO.odt embed_pack