Interacting documents with UNO make you learn how to use unotools. Look through these sample script, then it help you how to use unotools. (tmp3 )$ python sample-scripts/pdf-convert-sample1.py -s localhost -f sample.odt (tmp3 )$ python sample-scripts/pdf-convert-sample1.py -s localhost -f sample.ods (tmp3 )$ ls sample.pdf There’s a sample script to convert odt/ods to pdf. : (tmp3 )$ python sample-scripts/writer-sample1.py -s localhost (tmp3 )$ python sample-scripts/calc-sample1.py -s localhost -d sample-scripts/datadir/ (tmp3 )$ ls sample-calc.html sample-calc.pdf sample-calc_html_eaf26d01.png sample-scripts sample-writer.html sample-writer.pdf sample.csv sample.doc sample.ods sample.odt sample.xls Startup libreoffice: (tmp3 )$ soffice -accept = 'socket,host=localhost,port=8100 urp StarOffice.Service' > import unotools How to use (on Ubuntu 14.04) $ /Applications/LibreOffice.app/Contents/MacOS/soffice -version LibreOffice 4.4.0.3 de093506bcdc5fafd9023ee680b8c60e3e0645d7Ĭonfirm importing unotools package: $ /Applications/LibreOffice.app/Contents/MacOS/python Python 3.3.5 (default, Jan 22 2015, 17:12:45 ) on darwin Type "help", "copyright", "credits" or "license" for more information. On Mac OS X, soffice and python commands are as below. $ export PYTHONPATH = "/path/to/singledispatch/:/path/to/unotools/" $ hg clone PYTHONPATH to resolve additional packages in LibreOffice’s Python Interpreter version included in LibreOffice. $ hg clone Python 3.3 case, need singledispatch package. Install unotools from PyPI: (tmp3 )$ pip install unotools On Mac OS Xĭownload LibreOffice DMG package from and I like virtualenvwrapper to make temporary environment: $ sudo aptitude install -y virtualenvwrapper $ mkvirtualenv -p /usr/bin/python3.4 -system-site-packages tmp3Ĭonfirm importing uno module: (tmp3 )$ python Python 3.4.0 (default, Apr 11 2014, 13:05:11 ) on linux Type "help", "copyright", "credits" or "license" for more information. Install libreoffice, uno library and python3: $ sudo aptitude install -y libreoffice libreoffice-script-provider-python uno-libs3 python3-uno python3 The unotools is quite simple, but you ought to understand UNO APIs. Using the original UNO/PyUNO for scripting. The aim is to make handling OpenDocument easy than ResultSet rs = statement.UnoTools allows you to interact with /LibreOffice using executeQuery statement is below, along with error. Its there, in fact the statement produced in the error message will run when pasted into query in the database. I receive error that it cannot find tablename in statement. Trying to use example with a more complicated select from a table I have, named "Master List". Exiting"Įcho "Failed to move zip file $HSQLDB to $1. Exiting"Įcho "Failed to zip HSQLDB to $2/tmp.out. Exiting"Įcho "Failed to rename $2/database/$2.script. Exiting"Įcho "Failed to rename $2/database/$2.properties. Exiting"Įcho "Failed to rename $2/database/$2.data. Mv $2/database/$2.script $2/database/scriptĮcho "Failed to rename $2/database/$2.backup. Mv $2/database/$2.properties $2/database/properties Mv $2/database/$2.backup $2/database/backup Exiting."Įcho "Cannot find file $2/database/$2.script. Exiting."Įcho "Cannot find file $2/database/$2.properties. Exiting"Įcho "Cannot find file $2/database/$2.data. Exiting."Įcho "Cannot find file $2/database/$2.backup. Cannot find file $2/database/$2.script."Įcho "HSQLDB directory $2 does not exist. Cannot find file $2/database/$2.properties."Įcho "Error occured in conversion. Cannot find file $2/database/$2.data."Įcho "Error occured in conversion. Cannot find file $2/database/$2.backup."Įcho "Error occured in conversion. Mv $2/database/script $2/database/$2.scriptĮcho "Error occured in conversion. Mv $2/database/properties $2/database/$2.properties Mv $2/database/backup $2/database/$2.backup Exiting."Įcho "Failed to create directory. Aborting operation."Įcho "Failed to rename existing HSQLDB directory. ooo2hsqldb.sh test.odb hsqldb"Įcho "OOo Base file $1 does not exist.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |