What is unoconv?
«unoconv» is a command line program that is used to convert between different office document file formats. It uses an instance of LibreOffice to do the conversion and is used by the Assignment activity to convert documents to pdf so that they can be annotated. If unoconv is not installed — the only impact is that the assignment activities will only allow annotations when students upload a pdf document.
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on.
Installing unoconv on Linux
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:
Ubuntu 16.04 LTS
apt-get install unoconv
If your package manager contains an older version of the package, you will have to find a newer version and install it manually (Debian Testing). Unoconv itself is just a python script, so it has few dependencies.
Potential problems:
- On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this — one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).
- If you are still running 14.04LTS then unoconv won’t work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing ‘python’ in the first line to ‘python3’. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).
Ubuntu 14.04 LTS
1) Navigate to opt directory
cd /opt
2) Download unoconv
sudo wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv
3) Modify the Python unoconv file by changing ‘python’ in the first line to ‘python3’
sudo nano /opt/unoconv
eg.
#!/usr/bin/env python3
4) Make unoconv executable
sudo chmod ugo+x /opt/unoconv
5) Add LibreOffice PPA to your system and install the latest version
sudo add-apt-repository ppa:libreoffice/ppa sudo apt-get update sudo apt-get install libreoffice
6) Change permissions so apache can write to its home directory
sudo chown www-data /var/www
7) From your browser navigate to
Site administration > Server > System paths and add the path to unoconv
/opt/unoconv
- Note: if you would like to preserve the default path add a symbolic link to /usr/bin:
sudo ln -s /opt/unoconv /usr/bin/
Navigate to
Site administration > Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF > Test unoconv path
You should see:
«The unoconv path appears to be properly configured.»
- Download the converted pdf test file. (if the PDF fails to load ensure that www-data can write to its home directory: /var/www)
Debian Jessie
On Debian Stable, the cleanest method to install unoconv is using Jessie-backports. First, enable backports repo line in /etc/apt/sources.list:
#### Jessie-backports #### deb http://ftp.debian.org/debian jessie-backports main
Then, update and install unoconv from jessie-backports:
apt-get update apt-get install -t jessie-backports unoconv
The package will bring all necessary dependencies for you.
CentOS / RedHat
Just before you start, you might like to consider installing the latest LibreOffice 5.2 (5.3.4 as of July 2017) directly from RPM packages, that are not part of the distribution you are using.
As of nov-2016, CentOS and RedHat 7.2 comes with OpenOffice 4.3 . so if you are not interested in using this version and would like to install latest 5.3 independent LibreOffice 5.3.4 (July 2017), please remove any openoffice packages you might have on your OS by issuing:
yum remove openoffice* libreoffice*
And then follow the install instructions LibreOffice 5.2. It is recommended to chose your localized libreoffice version for better document conversions. and also please skip the following «yum install openoffice* …» command.
yum install openoffice* openoffice-pyuno git clone https://github.com/dagwieers/unoconv.git # copy cp unoconv/unoconv /usr/bin # or link unoconv to /usr/bin ln -s unoconv/unoconv /usr/bin/unoconv
Note: depends on what version you are installing, openoffice or libreoffice, make sure you installed the *-pyuno package. (the headless package is already compiled into the core)
Make sure it is properly configured:
http://your-moodle/admin/search.php?query=unoconv
Production servers should consider running unoconv in listener mode, see Installing_unoconv#Run_a_unoconv_listener or follow directions bellow
vi /etc/systemd/system/unoconv.service
And then copy and paste the following configuration into it:
[Unit] Description=Unoconv listener for document conversions Documentation=https://github.com/dagwieers/unoconv After=network.target remote-fs.target nss-lookup.target [Service] Type=simple Environment="UNO_PATH=/usr/lib64/libreoffice/program" ExecStart=/usr/bin/unoconv --listener [Install] WantedBy=multi-user.target
And then enable and start the above service
systemctl enable unoconv.service systemctl start unoconv.service
Additionally you may want to install a newer version of Ghostscript than is available on the RHEL repos, as the latest version includes several bug fixes that the current version may encounter during document conversions. You can do this by compiling and installing the latest version from source. Ghostscript 9.21 install as an example:
yum -y install git git clone --branch gs921 git://git.ghostscript.com/ghostpdl.git cd ghostpdl ./autogen.sh ./configure make make install cd /usr/bin mv gs gs.old mv /usr/bin/local/gs .
Installing unoconv on OS X
Download and install LibreOffice for Mac. Unfortunately — newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link — https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).
Get the latest version of the unoconv python script. One way to do this is with http://brew.sh/ brew.
brew install unoconv
If you haven’t done it already — install ghostscript. One way to install ghostscript is also with http://brew.sh/ brew
brew install ghostscript
Set the paths to unoconv and ghostscript in Moodle (Site administration > Server > System paths). If you used brew, they will both be installed to /usr/local/bin.
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.
There are some ways to get around this — one way is just to give the «_www» user write access to /Library/WebServer.
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.
Code to insert:
# Set home to a writable folder. os.environ['HOME'] = '/tmp/'
This needs to be inserted at line 36 immediately after the line «exitcode = 0»
Installing unoconv on Windows
Download and install LibreOffice for windows.
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases (download the zip version).
From the downloaded zip file — extract the one file «unoconv-0.7\unoconv» (no file extension). This is the unoconv script — none of the other files in the package are required.
Rename the downloaded script to C:\unoconv\unoconv.py
Create a batch file C:\unoconv\unoconv.bat with these contents:
@"C:\Program Files\LibreOffice 5\program\python.exe" c:\unoconv\unoconv.py %*
Set paths in Moodle.
Login as admin and go to Site administration > Server > System paths
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32c.exe)
(Do not use gswin32.exe or gswin64.exe, these are not command line programs — use gswin32c.exe or gswin64c.exe)
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)
Test ghostscript and unoconv are working correctly in the admin test pages «Site administration > Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF».
Run a unoconv listener
Unoconv utilises a client/server process when converting documents. By default, when there is no running server process — each time unoconv runs it will start a server process, send its request and shut down the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously — this can cause the first request to shutdown the server process when the second request is still in progress — and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.
To start a unoconv listener at boot time — you need a start up script. Different operating systems and Linux distributions use different startup scripts — but here are some examples of startup scripts for different systems.
Upstart script for Ubuntu based systems
Launchd script for OS X
Init script for Debian
Init script for CentOS/RedHat 6.x
SystemD service script for CentOS/RedHat 7.x
Offload processing to a different server
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.
How to do this:
Install unoconv on each webservers and the remote server following the installation instructions above.
Make sure unoconv is started at boot time on the remote server with the «—listener» argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). By default, unoconv will only listen on localhost (127.0.0.1): if you want to connect to the listener process from another server, you need to start the unoconv listener process with the «—server» argument too!
An example command for starting a listener on a remote server (0.0.0.0 listens on all interfaces):
unoconv --listener --server 0.0.0.0 --port 2002
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers.
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:
#!/bin/bash # Wrapper script for unoconv to forward processing. # Install to /usr/bin/unoconv-remote with 755 permissions /usr/bin/unoconv --server=<ip of remote server> "$@"
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.
Additional resources
The unoconv documentation site has additional information on installation of unoconv and troubleshooting tips.
See also
- Is the unoconv installation a security risk? forum discussion
Automated conversion and styling using LibreOffice
Unoconv is deprecated
We are running Unoserver successfully in production, and it’s now the
recommended solution.
Unoserver does not have all the features of Unoconv, which features it
will get depends on a combination of what people want, and if someone
wants to implement it.
Until Unoserver has all the major features people need, Unoconv is in
bugfix mode, there will be no major changes. Once Unoserver has the major
features of Unoconv, Unoconv will become unsupported.
Unoconv
Universal Office Converter (unoconv) is a command line tool to convert any
document format that LibreOffice can import to any document format that
LibreOffice can export. It makes use of the LibreOffice’s UNO bindings for
non-interactive conversion of documents.
For practical reasons we mention LibreOffice, but OpenOffice is supported by
unoconv as well.
Installing unoconv
unoconv can be installed using packages coming from your distribution, or
simply by copying the unoconv python script to your system.
If you installed unoconv by hand, make sure you have the required LibreOffice
or OpenOffice packages installed. A hard requirement is the UNO python bindings
which are often inside a subpackage named libreoffice-pyuno or
libobasis4.4-pyuno.
Various sub-packages are needed for specific import or export filters, e.g.
XML-based filters require the xsltfilter subpackage,
e.g. libobasis4.4-xsltfilter.
Important |
Neglecting these requirements will cause unoconv to fail with unhelpful and confusing error messages. |
To find a good Python installation to use to run unoconv, do the following:
To find which Python to use to run unoconv, you can try a script I made.
cd /tmp wget -l https://gist.githubusercontent.com/regebro/036da022dc7d5241a0ee97efdf1458eb/raw/1bc0655423d196acd79a5d9fa60d2baada8dd534/find_uno.py python3 find_uno.py
It should list all Pythons that have Libreoffice libraries installed.
How does unoconv work ?
unoconv starts its own office instance (if it cannot find an existing
listener) that it then uses. There are some challenges to do this
correctly, but in general this works fine.
Typically you would convert an ODT document to PDF by running:
unoconv -f pdf some-file.odt
Start your own unoconv listener
However, you can always start an instance yourself at the default port 2002
(or specify another port with -p/—port) and after use you can tear it down:
unoconv --listener & sleep 20 unoconv -f pdf *.odt unoconv -f doc *.odt unoconv -f html *.odt kill -15 %-
It is also possible to use a listener or LibreOffice instance that accepts
connections on another system and use it from unoconv remotely. This
way the conversion tasks are performed on a dedicated system instead
of on the client system. This works only if you have a shared filesystem
mounted at the same location.
Python and pyuno incompatibilities
Beware that the pyuno python module needs to be compiled with the exact
same version of python that you are using to load it. A lot of people that
run into problems loading pyuno are actually using a precompiled LibreOffice
that they downloaded somewhere and is incompatible with the python version
on their system.
To solve this issue, the project’s office suite ships with its own python
interpreter located in the ‘program’ directory, this one should work
flawlessly.
The most recent unoconv works around this issue by automatically detecting
incompatibilities, and restarting itself using a compatible python (the same
one that ships with LibreOffice).
You can influence the automatic detection by setting the UNO_PATH environment
variable to point to an alternative LibreOffice installation, e.g.:
UNO_PATH=/opt/libreoffice4.4 unoconv -f pdf some-file.odt
But you can also force another python by using it to execute unoconv, e.g.:
/opt/libreoffice4.4/program/python.bin unoconv -f pdf some-file.odt
or on macOS:
/Applications/LibreOffice.app/Contents/MacOS/python unoconv -f pdf some-file.odt
or on Windows:
C:\Program Files (x86)\LibreOffice 4.4\program\python.exe unoconv -f pdf some-file.odt
Tip |
If you plan to use unoconv extensively (or in an automated fashion) it is more efficient to use the correct python interpreter directly. Or event put it directly in the Shebang (the first line) of the unoconv script ! |
Using unoconv with no X display
Using unoconv with macOS
LibreOffice 3.6.0.1 or later is required to use unoconv under macOS. This
is the first version distributed with an internal python script that works.
No version of OpenOffice for macOS (3.4 is the current version) works because
the necessary internal files are not included inside the application.
Problems running unoconv from Nginx/Apache/PHP
Some people have had difficulties using unoconv through webservices. Here
is a list of probable causes and recommendations:
-
Use the latest version of unoconv (or GitHub master branch)
-
Use the most recent stable release of LibreOffice (less memory, more stable, fewer crashes)
-
Use the native LibreOffice python binary to run unoconv
-
Hardcode this native python path in the unoconv script shebang (or ensure PATH is set)
-
Ensure that the user running unoconv has write access to its HOME directory (ensure HOME is set)
-
Test with SELinux in permissive mode
It is recommended to open the unoconv script and modify the very first line to
point directly to your installed LibreOffice python binary, so replace this:
with something like this:
#!/opt/libreoffice4.4/program/python
Conversion problems
If you encounter problems converting files, it often helps to try again. If
you are using a listener, restarting the listener may help as well.
The reason for conversion failures are unclear, and they are not
deterministic. unoconv is not the only project to have noticed problems
with import and export filters using PyUNO. We assume these are related
to internal state or timing issues that under certain conditions fail
to correctly work.
If you can reproduce the problem on a specific file, please take the time to
open the file in LibreOffice directly and export it to the desired format. If
this fails, it needs to be reported to the LibreOffice project directly. If
that works, we need to know !
We are looking into this with the LibreOffice developers to:
-
Collaborate closer to find, report and fix unexpected failures
-
Allow end-users to increase debugging and improve reporting to the project
Troubleshooting instructions
If you encounter a problem with converting documents using unoconv, please
consider that this could be caused by a number of things:
-
incomplete LibreOffice installation
-
LibreOffice bug or regression specific to your version/distribution
-
LibreOffice import or export filter issue
-
problem related to stale lock files
-
problem related to the source document
-
problem related to permissions or SELinux
-
problem related to the python UNO bindings
-
problem related to the unoconv python script
It is recommended to follow all of the below steps to pinpoint the problem:
-
if this is the first time you are using LibreOffice/OpenOffice, make sure
you have all the required sub-packages installed, depending on the
distribution this could be the xsltfilter, headless, writer,
calc, impress or draw sub-packages. -
check if there is no existing LibreOffice process running on the system
that could interfere with proper functioning# pgrep -l 'office|writer|calc'
-
check that there are no stale lock files present, e.g. ‘.~lock.file.pdf#’ or
‘.~lock.index.html#’ -
check that the LibreOffice instance handling UNO requests is not handling
multiple requests at the same time -
try using the latest unoconv release, or the latest version on Github at:
https://github.com/dagwieers/unoconv/downloads -
try the conversion by opening the file in LibreOffice and exporting
it through LibreOffice directly -
try unoconv with a different minor or major LibreOffice version to test
whether it is a regression in LibreOffice -
try to load the UNO bindings in python manually:
-
do this with the python executable that ships with the LibreOffice
package/installer# /opt/libreoffice4.4/program/python.bin -c 'import uno, unohelper'
-
or alternatively, run the distribution python (with the distribution
LibreOffice)# python -c 'import uno, unohelper'
-
-
try unoconv with a different python interpreter manually:
# /opt/libreoffice4.4/program/python.bin unoconv -f pdf test-file.odt
If you tried all of the above, and the issue still remains, the issue might
still be related to import/export filters, LibreOffice or unoconv, so please
report any information to reproduce the problem on the Github issue-tracker
at: https://github.com/dagwieers/unoconv/issues
And do mention that you already tried the above hints to troubleshoot the issue.
Interesting information
Other implementations
Related tools
Automated conversion and styling using LibreOffice
Dag Wieers <dag@wieers.com>
Universal Office Converter (unoconv) is a command line tool to convert any
document format that LibreOffice can import to any document format that
LibreOffice can export. It makes use of the LibreOffice’s UNO bindings for
non-interactive conversion of documents.
_For practical reasons we mention LibreOffice, but OpenOffice is supported by
unoconv as well._
Installing unoconv
unoconv can be installed using packages coming from your distribution, or
simply by copying the unoconv python script to your system.
If you installed unoconv by hand, make sure you have the required LibreOffice
or OpenOffice packages installed. A hard requirement is the UNO python bindings
which are often inside a subpackage named +libreoffice-pyuno+ or
+libobasis4.4-pyuno+.
Various sub-packages are needed for specific import or export filters, e.g.
XML-based filters require the xsltfilter subpackage,
e.g. +libobasis4.4-xsltfilter+.
IMPORTANT: Neglecting these requirements will cause unoconv to fail with
unhelpful and confusing error messages.
How does unoconv work ?
unoconv starts its own office instance (if it cannot find an existing
listener) that it then uses. There are some challenges to do this
correctly, but in general this works fine.
Typically you would convert an ODT document to PDF by running:
unoconv -f pdf some-file.odt
Start your own unoconv listener
However, you can always start an instance yourself at the default port 2002
(or specify another port with -p/–port) and after use you can tear it down:
unoconv --listener & sleep 20 unoconv -f pdf *.odt unoconv -f doc *.odt unoconv -f html *.odt kill -15 %-
It is also possible to use a listener or LibreOffice instance that accepts
connections on another system and use it from unoconv remotely. This
way the conversion tasks are performed on a dedicated system instead
of on the client system. This works only if you have a shared filesystem
mounted at the same location.
Python and pyuno incompatibilities
Beware that the pyuno python module needs to be compiled with the exact
same version of python that you are using to load it. A lot of people that
run into problems loading pyuno are actually using a precompiled LibreOffice
that they downloaded somewhere and is incompatible with the python version
on their system.
To solve this issue, the project’s office suite ships with its own python
interpreter located in the ‘program’ directory, this one should work
flawlessly.
The most recent unoconv works around this issue by automatically detecting
incompatibilities, and restarting itself using a compatible python (the same
one that ships with LibreOffice).
You can influence the automatic detection by setting the +UNO_PATH+ environment
variable to point to an alternative LibreOffice installation, e.g.:
UNO_PATH=/opt/libreoffice4.4 unoconv -f pdf some-file.odt
But you can also force another python by using it to execute unoconv, e.g.:
/opt/libreoffice4.4/program/python.bin unoconv -f pdf some-file.odt
or on macOS:
/Applications/LibreOffice.app/Contents/MacOS/python unoconv -f pdf some-file.odt
or on Windows:
C:\Program Files (x86)\LibreOffice 4.4\program\python.exe unoconv -f pdf some-file.odt
TIP: If you plan to use unoconv extensively (or in an automated fashion) it
is more efficient to use the correct python interpreter directly. Or event
put it directly in the Shebang (the first line) of the unoconv script !
Using unoconv with no X display
Since OpenOffice 2.3 you do not need an X display for starting ooffice.
However you may need the openoffice.org-headless package from your
distribution. Since LibreOffice 2.4 nothing special is needed, running
in headless mode does not require X.
For any older OpenOffice releases, remember that ooffice requires an X
display, even when using it in headless mode. One solution is to use Xvfb
to create a headless X display for ooffice.
http://www.oooforum.org/forum/viewtopic.phtml?t=11890
http://www.wonko.be/2008/01/09/running-openoffice-headless-on-debian
http://ward.vandewege.net/writings/200510auto_doc_conv/
http://www.artofsolving.com/node/10
Using unoconv with macOS
LibreOffice 3.6.0.1 or later is required to use unoconv under macOS. This
is the first version distributed with an internal python script that works.
No version of OpenOffice for macOS (3.4 is the current version) works because
the necessary internal files are not included inside the application.
Problems running unoconv from Nginx/Apache/PHP
Some people have had difficulties using unoconv through webservices. Here
is a list of probable causes and recommendations:
Use the latest version of unoconv (or GitHub master branch)
Use the most recent stable release of LibreOffice (less memory, more stable, fewer crashes)
Use the native LibreOffice python binary to run unoconv
Hardcode this native python path in the unoconv script shebang (or ensure PATH is set)
Ensure that the user running unoconv has write access to its HOME directory (ensure HOME is set)
Test with SELinux in permissive mode
It is recomended to open the unoconv script and modify the very first line to
point directly to your installed LibreOffice python binary, so replace this:
#!/usr/bin/env python
with something like this:
#!/opt/libreoffice4.4/program/python
Conversion problems
If you encounter problems converting files, it often helps to try again. If
you are using a listener, restarting the listener may help as well.
The reason for conversion failures are unclear, and they are not
deterministic. unoconv is not the only project to have noticed problems
with import and export filters using PyUNO. We assume these are related
to internal state or timing issues that under certain conditions fail
to correctly work.
If you can reproduce the problem on a specific file, please take the time to
open the file in LibreOffice directly and export it to the desired format. If
this fails, it needs to be reported to the LibreOffice project directly. If
that works, we need to know !
We are looking into this with the LibreOffice developers to:
Collaborate closer to find, report and fix unexpected failures
Allow end-users to increase debugging and improve reporting to the project
Troubleshooting instructions
If you encounter a problem with converting documents using unoconv, please
consider that this could be caused by a number of things:
incomplete LibreOffice installation
LibreOffice bug or regression specific to your version/distribution
LibreOffice import or export filter issue
problem related to stale lock files
problem related to the source document
problem related to permissions or SELinux
problem related to the python UNO bindings
problem related to the unoconv python script
It is recommended to follow all of the below steps to pinpoint the problem:
if this is the first time you are using LibreOffice/OpenOffice, make sure
you have all the required sub-packages installed, depending on the
distribution this could be the +xsltfilter+, +headless+, +writer+,
+calc+, +impress+ or +draw+ sub-packages.check if there is no existing LibreOffice process running on the system
that could interfere with proper functioning# pgrep -l ‘office|writer|calc’
check that there are no stale lock files present, e.g. ‘.~lock.file.pdf#’ or
‘.~lock.index.html#’
check that the LibreOffice instance handling UNO requests is not handling
multiple requests at the same time
- try using the latest unoconv release, or the latest version on Github at::
https://github.com/dagwieers/unoconv/downloads
try the conversion by opening the file in LibreOffice and exporting
it through LibreOffice directlytry unoconv with a different minor or major LibreOffice version to test
whether it is a regression in LibreOfficetry to load the UNO bindings in python manually:
do this with the python executable that ships with the LibreOffice
package/installer# /opt/libreoffice4.4/program/python.bin -c ‘import uno, unohelper’
or alternatively, run the disribution python (with the distribution
LibreOffice)
# python -c ‘import uno, unohelper’
try unoconv with a different python interpreter manually:
# /opt/libreoffice4.4/program/python.bin unoconv -f pdf test-file.odt
If you tried all of the above, and the issue still remains, the issue might
still be related to import/export filters, LibreOffice or unoconv, so please
report any information to reproduce the problem on the Github issue-tracker
at: https://github.com/dagwieers/unoconv/issues
And do mention that you already tried the above hints to troubleshoot the issue.
Interesting information
If you’re interested to help out with development, here are some pointers to
interesting sources:
[Tutorial] Import uno module to a different Python install
http://user.services.openoffice.org/en/forum/viewtopic.php?f=45&t=36370&p=166783UDK: UNO Development Kit
http://udk.openoffice.org/Python-UNO bridge
http://www.openoffice.org/udk/python/python-bridge.htmlPython and OpenOffice.org
http://wiki.services.openoffice.org/wiki/PythonOpenOffice.org developer manual
http://api.openoffice.org/DevelopersGuide/DevelopersGuide.htmlFramework/Article/Filter/FilterList OOo 2 1
http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_2_1Framework/Article/Filter/FilterList OOo 3 0
http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0
Other implementations
Other implementations using python and UNO:
convwatch
http://cgit.freedesktop.org/libreoffice/core/tree/bin/convwatch.pyoooconv
https://svn.infrae.com/oooconv/trunk/src/oooconv/filters.pyofficeshots.org
http://code.officeshots.org/trac/officeshots/browser/trunk/factory/src/backends/oooserver.pycloudooo
http://svn.erp5.org/erp5/trunk/utils/cloudooo.handler/ooo/cloudooo/handler/ooo/
table of contents
DEPRECATED please use the libreoffice extension instead
Extension using unoconv to convert reports to the OpenoOffice/LibreOffice supported formats
Installation
Linux
npm i @jsreport/jsreport-unoconv
apt-get install unoconv
Windows
- Install Python
- Download unoconv script.
- Install LibreOffice
npm i @jsreport/jsreport-unoconv
- Configure jsreport
{
"extensions": {
"unoconv": {
"command": "python [unoconvScriptPath]"
}
}
}
Usage
- Prepare template generating an office document like xlsx or docx
- Open unoconv properties and specify desired output format like pdf
- Run the template
Parallel run
The LibreOffice doesn’t support parallel run of the requests. The workaround is to use a global lock on unoconv
{
"extensions": {
"unoconv": {
"command": "/usr/bin/timeout 30 flock -w 20 lockfile /usr/bin/unoconv"
}
}
}
This workaround was originally described on forum.
Configuration
{
"extensions": {
"unoconv": {
"command": "custom unoconv command"
}
}
}
Skip to content
install
Star us on GitHub
View `x install` guide
Convert between any document format supported by LibreOffice/OpenOffice
Language | Python |
Homepage | https://github.com/unoconv/unoconv |
sh
x install unoconv
x env |
sh
|
/wget |
sh
|
Related Link
Package
unoconv
1min
unoconv