Code Monkey home page Code Monkey logo

unoconv's Introduction

Automated conversion and styling using LibreOffice

Unoconv is deprecated

Please note that there is a rewrite of Unoconv called "Unoserver": https://github.com/unoconv/unoserver/

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

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.

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:

#!/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 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

If you’re interested to help out with development, here are some pointers to interesting sources:

Other tools that are useful or similar in operation:

unoconv's People

Contributors

dagwieers avatar damycra avatar dks avatar eagleas avatar erbbysam avatar gazofnaz avatar graaff avatar ibash avatar integritydc avatar jacobmischka avatar josiasmontag avatar kaplun avatar kaysersoze avatar l3thal avatar lars-sh avatar m1waterman88 avatar monomelodies avatar nadavkav avatar ojwb avatar pataquets avatar peterdemin avatar pquentin avatar raphink avatar regebro avatar skywinder avatar vincentbernat avatar vmiklos avatar vpa avatar wmin0 avatar xrmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unoconv's Issues

Deprecated command

I'm using unoconv 0.4 and if I want to convert a LibreOffice (3.4.4) document I get some warnings:

Warning: -headless is deprecated. Use --headless instead.
Warning: -invisible is deprecated. Use --invisible instead.
Warning: -nodefault is deprecated. Use --nodefault instead.
Warning: -nofirststartwizard is deprecated. Use --nofirststartwizard instead.
Warning: -nologo is deprecated. Use --nologo instead.
Warning: -norestore is deprecated. Use --norestore instead.
Warning: -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext is deprecated. Use --accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext instead.

I think unoconv should use the new arguments if it detects LibreOffice.

Converting with LibreOffice 3.5.0 doesn't work every time

With the latest trunk I can't convert a document anymore with LibreOffice 3.5.0. I get just an error message:

terminate called after throwing an instance of 'com::sun::star::registry::InvalidRegistryException'

This happens only with the upstream package of LibreOffice 3.5.0. The package from the Ubuntu repository is working fine.

Trouble upgrading to CentOS 6

I setup unoconv & openoffice on a cent 5.8 machine, and got things working perfectly using the following commands:

  1. sudo yum install openoffice.org-pyuno openoffice.org-headless
  2. sudo rpm -ivh http://pkgs.repoforge.org/unoconv/unoconv-0.5-1.el5.rf.noarch.rpm
  3. unoconv -n -d presentation -f ppt preso.odp

The above commands installed openoffice 3.1.1-19.10.el5_8.1

So I went to do the same on Cent 6.2 (except I changed the unoconv to unoconv-0.5-1.el6.rf.noarch.rpm), and I ran into one problem after another:

  1. Yum installed OpenOffice 3.2.1-19.6.el6_0.5, which for some reason did not include the soffice binary. After some digging, and trial and error, I was able to get the binary by installing openoffice.org-writer
  2. I get the following error when running: unoconv -n -d presentation -f ppt preso.odp

UNO IllegalArgument during import phase: Source file cannot be read. URL seems to be an unsupported one.

I made sure the permissions & owner on preso.odp are correct (and tried adding a sudo in front), but it didn't help.

I've been googling around for a few days now, and haven't found anything fruitful.

I tried installing Openoffice 3.1.1, but ran into dependency hell, and didn't make any progress.

I also noticed that Cent 5.8 has python 2.4.3 whereas Cent 6 uses 2.6.6, but I'm not sure if that makes a difference.

I tried looking at the Troubleshooting section in the README, but a lot of it seemed specific to LibreOffice, so I was wondering if anyone else has run into similar issues.

Thanks.

UnoException during import phase

Hello Dag,

I'm a bit confused by this one. The listener is running and things start up okay, but as you can see . . .

./unoconv -f odt -vvvv ./myTestFile.doc
Verbosity set to level 3
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Office base location: /usr/lib/libreoffice
Office binary location: /usr/lib/libreoffice/basis-link/program
Input file: ./myTestFile.doc
unoconv: UnoException during import phase in <class 'main.com.sun.star.lang.IllegalArgumentException'>

I am using the latest github unoconv (from today) and LibreOffice 3.4.4 on Ubuntu 11.10 Oneiric.

Thanks for any help you can offer on this one.

Marcel Gagné
Writer and Free Thinker at Large
Note: This massagee wos nat speel or gramer-checkered.

Unoconv version check is incorrect, fails on older LibreOffice

unoconv opens libreoffice (version 3.3.2, from the info dialo box) main window instead of executing conversion. After closing the window it says thet was "Unable to connect or start own listener. Aborting." This is what I had on my console:

# unoconv -vvvvvvvvvvvv -f pdf t.odt
Verbosity set to level 11
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Office base location: /usr/lib64/libreoffice
Office binary location: /usr/lib64/libreoffice/basis-link/program
Existing listener not found.
Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=31457)
Process /usr/lib64/libreoffice/program/soffice.bin (pid=31457) exited with 0.
Error: Unable to connect or start own listener. Aborting.

Further investigations (I'm a programmer but I didn't know well Python) adding some debug line:

@@ -654,10 +654,13 @@
             info(3, "Launching our own listener using %s." % office.binary)
             try:
                 product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
-                if product.ooName != "LibreOffice" or product.ooSetupVersion <= 3.3:
+                info(2, 'Found version %s v%s' % (product.ooName, product.ooSetupVersion))
+                if product.ooName != "LibreOffice" or product.ooSetupVersion <= "3.3":
                     ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ)
+                    info(2, 'Single dash')
                 else:
                     ooproc = subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--accept=%s" % op.connection], env=os.environ)
+                    info(2, 'Double dash')
                 info(2, '%s listener successfully started. (pid=%s)' % (product.ooName, ooproc.pid))

                 ### Try connection to it for op.timeout seconds (flakky OpenOffice)

And I obtained a succesfull run:

$ unoconv -vvvvvvvvvvvv -f pdf ~/t.odt
Verbosity set to level 11
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Office base location: /usr/lib64/libreoffice
Office binary location: /usr/lib64/libreoffice/basis-link/program
Existing listener not found.
Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
Found version LibreOffice v3.3
Single dash
LibreOffice listener successfully started. (pid=11180)
Input file: /home/aliccardo/t.odt
Selected output format: Portable Document Format [.pdf]
Selected office filter: writer_pdf_Export
Used doctype: document
Output file: /home/aliccardo/t.pdf
Terminating LibreOffice instance.
Waiting for LibreOffice instance to exit.

Strangely the LibreOffice version is 3.3 instead of 3.3.2
hope this will help!

UNO IllegalArgument during import phase: Source file cannot be read. URL seems to be an unsupported one.

If I try to convert http://www.users.dircon.co.uk/~hancock/antioch2.doc, I get an error:

$ unoconv -f pdf antioch2.doc 
unoconv: UnoException during conversion in <class '__main__.com.sun.star.lang.IllegalArgumentException'>: URL seems to be an unsupported one.
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 801, in <module>
    main()
  File "/usr/bin/unoconv", line 780, in main
    convertor.convert(inputfn)
  File "/usr/bin/unoconv", line 690, in convert
    error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
  File "/usr/lib/python2.7/site-packages/uno.py", line 318, in _uno_struct__getattr__
    return __builtin__.getattr(self.__dict__["value"],name)
AttributeError: ErrCode

Many thanks for your help,

Pablo

SystemError: dynamic module not initialized properly

Hi,

I am using Ubuntu 11.04

$ unoconv --version  
unoconv 0.3  
Written by Dag Wieers <***@wieers.com>  
Homepage at http://dag.wieers.com/home-made/unoconv/  

platform posix/linux2  
python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)  
[GCC 4.5.2]  

build revision $REV$

when I tried to convert odp to pdf from terminal it shows this:

$ unoconv -f pdf test.odp  
/usr/lib/libreoffice/program/../basis-link/ure-link/bin/javaldx: /usr/local/lib/libxml2.so.2: no version information available   (required by /usr/lib/ure/bin/../lib/libjvmfwk.so.3)  
/usr/lib/libreoffice/program/soffice.bin: /usr/local/lib/libxml2.so.2: no version information available (required by /usr/lib/libreoffice/program/../basis-link/program/libsfxli.so)  
/usr/lib/libreoffice/program/soffice.bin: /usr/local/lib/libxml2.so.2: no version information available (required by /usr/lib/libreoffice/program/../ure-link/lib/libjvmfwk.so.3)

But this command converts my odp to pdf.

When I use the following in a php script echo shell_exec('unoconv -f pdf test.odp 2>&1'); the following error occured and did not convert:

/usr/bin/python: /opt/lampp/lib/libz.so.1: no version information available (required by /usr/bin/python) Traceback (most recent call last): File "/usr/bin/unoconv", line 24, in import uno, unohelper File "/usr/lib/python2.7/dist-packages/uno.py", line 34, in import pyuno SystemError: dynamic module not initialized properly

Problem
I want to use unoconv from PHP Script. Please help me to solve the issue....

unoconv: Cannot find a suitable pyuno library and python binary combination

I did a git clone and running into following error message. I don't have openoffice but I have libreoffice write/calc/Impress installed on my machine. Any thoughts what's the issue? (I'm using Fedora16 and Python-2.7.2)

./unoconv

unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib64/libreoffice
ERROR: Please locate this library and send your feedback to:
http://github.com/dagwieers/unoconv/issues
No module named uno
unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
http://github.com/dagwieers/unoconv/issues

Making selections before conversion

In some cases users would like to make selections before doing the conversion, this could be useful in order to:

  • select a specific sheet in a spreadsheet to convert (currently only the first sheet is converted)
  • select a specific range in a spreadsheet to convert
  • select a specific range of pages to convert

The difficulty here is two-fold:

  • how do we describe the various pieces for doing the selection
  • how do we instruct LibreOffice to perform the description of what the user needs

So a lot of discussion around this is needed to understand the various requirements and implementation bits. Feedback welcome

extrapath for LO on OpenBSD

hello,

LO on OpenBSD uses different path, so here's patch:

diff --git a/unoconv b/unoconv
index ca9f5f2..7610817 100755
--- a/unoconv
+++ b/unoconv
@@ -21,6 +21,7 @@ global convertor, oobin, oobinpath, oolibpath, ooproc
 ### The first thing we ought to do is find a suitable OpenOffice installation
 ### with a compatible pyuno library that we can import.
 extrapaths = glob.glob('/usr/lib*/libreoffice*/basis*/program') + \
+             glob.glob('/usr/local/lib/libreoffice*/basis*/program') + \
              glob.glob('/opt/libreoffice/program') + \
              glob.glob('/usr/lib*/openoffice*/program') + \
              glob.glob('/usr/lib*/openoffice*/basis*/program') + \

unoconv: Cannot find the pyuno library in sys.path and known paths.

Hello,

I tried to run unoconv with python 3.2, but this gave a compiler error.
So I switched to 2.7.1.
Then I got the error that it cannot import the uno and unohelper lib.
I checked, on that directory the uno.py and unohelper.py files are available.
But I have no clue why it could import.

Find below my screen shot.

Best regards,
Karel.

M:\unoconv-0.4>d:\locals\python27\python unoconv
DLL load failed: The specified module could not be found.
WARNING: Found pyuno.pyd in C:\Program Files\OpenOffice.org 3\Basis\program, but could not import it.
unoconv: Cannot find the pyuno library in sys.path and known paths.
ERROR: Please locate this library and send your feedback to: [email protected].

Close after launching listener

When calling "unoconv --listener" unoconv stays running.

But why? It'd be nice to see unoconv being cancelled just after starting the listener. That'd (e.g.) remove the additional python process, that's kept open...

ODT use problem

I'm using UNOCONV 0.4 to convert a CSV file to ODS spreadsheet using a template (.ots) but for some reason it's not working. when UNOCONV runs in verbose mode, it indicates that it using the template, The ODS is generated but the template configurations are note there.

I'm using the folow command line:

unoconv -v -f ods -t template.ots -i 59,34,utf-8,2 -o teste file.csv

Can you help me find out what I'm doing wrong ?

Thanks for any help

Gerson Tessler

LibreOffice should use SVG natively

LibreOffice at the moment adds SVG vector graphics stored in a Starview Metafile (SVM), so it expects others to do the same thing. It would be so much better if LibreOffice would accept and add SVG files natively (in base64).

This has to be discussed with the LibreOffice/OpenOffice people.

unoconv needs 2 times to connect to LibreOffice

on my machine unoconv needs everytime 2 times to connect to libreoffice.
first time it says:
Error: Unable to connect or start own listener. Aborting.
on second time it is working.
i havo no idea why it doesn't work. it doesn't matter if libreoffice is running or not.

Installation under Windows? "Cannot find a suitable office installation"

Hi,

I have been trying to install under windows for use with (RS) ResourceSpace (resourcespace.org)

Is it really possible to presently use unoconv under windows Xp at all?
I just wanted to run past people what I have tried so far please.

From a RS perspective this is what I have tried so far...

I got a zip down from the unoconv git site, unpacked it into my
ResourceSpace utils area (self made), made a copy of uniconv as
uniconv.py

I added a system environment variable UNO_PATH pointing to my
LibreOffice uno.py etc location
(D:\Program Files\LibreOffice 3.4\Basis\program) I have also tried it as D:/Program Files/LibreOffice 3.4/Basis/program/

Made sure that Python 2.6 was in my path as the Python executable, and
even added LibreOffice executible directory as well.

Tried to run uniconv.py directly in its own directory to check
things. But it says...

"unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
http://github.com/dagwieers/unoconv/issues"

Then I looked in and around the LibreOffice directory tree and saw
that under the location of uno.py there is a python exe in D:\Program
Files\LibreOffice 3.4\Basis\program\python-core-2.6.1\bin

I tried using it to run unoconv, but this gave me the same message as
above.

1.) Is it possible nonetheless to configure unoconv to use the Open/Libre
office python.exe to run unoconv?

This would guarantee that the correct version of python was being used
for Open/Libre office (a unoconv requirement)? ( I had hoped that 2.6
would suffice for 2.61)

Any pointers for a possible Windows installation greatly appreciated please.

Paul

unoconv doesn't work anymore on Fedora 17

Hi,

I am the developer of GNOME Documents [1], which application that uses unoconv to convert office format documents to PDF for view.
Since some time (probably due to LibreOffice 3.5?) unoconv stopped working on Fedora 17 (which is currently shipping LibreOffice 3.5.1.2). The error I get trying to convert an ODT from the command line (with git master) is the following:

[cosimoc@x201: unoconv]$ (master) ./unoconv -f pdf '/home/cosimoc/Documents/dropbox-tos.odt'
Unknown option --nocrashreport
Run 'soffice --help' to see a full list of available command line options.
Error: Unable to connect or start own listener. Aborting.

It would be great to see this fixed in time for the round of stable releases coming out in April. Thanks.

[1] http://git.gnome.org/browse/gnome-documents

DLL load failed on windows

I have OpenOffice 3.3 installed on windows 7 machine and using python 2.6.1 that comes with OpenOffice.

DLL load failed: The specified module could not be found.
WARNING: Found pyuno.pyd in C:\Program Files (x86)\OpenOffice.org 3\Basis\program, but could not import it.

LibreOffice 3.5.0 crashes when using python UNO

For the details of this bug, look here:
https://bugs.freedesktop.org/show_bug.cgi?id=45696

Using LibreOffice 3.5.0 (or test releases) loading the uno python module causes a crash:

[dag@moria ~]$ /opt/libreoffice3.5/program/python
Python 2.6.1 (r261:67515, Feb  1 2012, 15:06:46)
[GCC 4.2.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
> > >  import uno
terminate called after throwing an instance of 'com::sun::star::registry::InvalidRegistryException'
Aborted (core dumped)

This issue was discussed and traced in the following mailinglist thread:
http://lists.freedesktop.org/archives/libreoffice/2012-February/025166.html

JPEG export filter seems to have a size limit

I'm using unoconv to convert some files at work. It seems the program get stuck whenever it runs into files with size larger than 6mb-ish. When I hit Ctrl+C to break, the error message is:

unoconv: SystemError during conversion: Couldn't instantiate python representation of structered UNO type com.sun.star.lang.DisposedException
ERROR: The provided document cannot be converted to the desired format.

I should also note that it's working wonderfully for all the smaller files.

I'm running this on a virtual machine with following specs:

Memory: 3.9GB
Processor: Intel® Xeon(R) CPU E5520 @ 2.27GHz × 4
OS type: Ubuntu 11.04 64-bit
Running on LibreOffice 3, with unoconv 0.4

Update: It seems that the files will be converted when the output format is in pdf and not when in jpg.

upgrade from unoconv 0.3-6 - ubuntu 10.10

This is more of a sysadmin question I suppose, but I'm quite stuck and would appreciate your help.

I've installed 'apt-get install unoconv'. When I do a 'apt-show-versions unoconv' I get 'unoconv/maverick uptodate 0.3-6' which I believe to be an old version of unoconv.

I've guessing it's doing this either because I don't have upto date repositories or there's some dependencies which can't be installed on ubuntu 10.10 (perhaps libreoffice?).

I understand that unconv is just a python script and I could install it manually but I'm afraid this is a bit beyond my current technical knowledge.

So, could you explain how best to upgrade? Either through a repo or a manual install.

Many Thanks

SElinux Problems When Running Indirectly

Hi guys! Just wasted almost 2 days trying to run unoconv from PHP/Apache at server with Fedora 15, (had to install libreoffice-headless as well). Guess it's not really unoconv issue, but would be nice to warn others somewhere, that if they have some problem launching unoconv, try stop SElinux first (like setenforce 0) and see what happens. In my case it gave errors like:

[Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed!
Failed to connect to /usr/bin/soffice (pid=4478) in 6 seconds.
Connector : couldn't connect to socket (Success)
Error: Unable to connect or start own listener. Aborting.

Not a word about SElinux, heh?! Well I had to run audit2allow lot of times and generate big'n'ugly SElinux policy module opening whole bunch of security holes, but that's the best quick and dirty solution for those who does not want to fight with SElinux tutorials...

selinux.txt not a valid asciidoc document

Hi!

selinux.txt is not a valid asciidoc and therefore cannot be turned into the appropriate selinux.html. I just choose to not compile it with the following patch:

diff --git a/docs/Makefile b/docs/Makefile
index 934368a..31b3ca7 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -2,7 +2,7 @@ prefix = /usr
 datadir = $(prefix)/share
 mandir = $(datadir)/man

-txttargets = $(shell echo *.txt)
+txttargets = $(filter-out selinux.txt,$(shell echo *.txt))
 htmltargets = $(patsubst %.txt, %.html, $(txttargets))

 all:

uno.RuntimeException: URP-Bridge: disposed(tid=3) Unexpected connection closure

I'm getting this error from a master branch install, Libreoffice 3.3.2. Any help is appreciated...

ehynds@ehynds ~/exports: unoconv -f doc 793.html

Traceback (most recent call last):
  File "/usr/bin/unoconv", line 947, in <module>
    main()
  File "/usr/bin/unoconv", line 879, in main
    convertor = Convertor()
  File "/usr/bin/unoconv", line 583, in __init__
    unocontext = resolver.resolve("uno:%s" % op.connection)
uno.RuntimeException: URP-Bridge: disposed(tid=3) Unexpected connection closure

IIS socket problem?

I'm working on simple "HOWTOs" to run unoconv (from SVN) via PHP on Ubuntu 11.10 (using Apache 2.2) and on Windows (using either Apache 2.2 or IIS 7.5).

On Apache 2.2 things go just right, but on IIS 7.5 unoconv starts successfully (I see the python.exe/soffice.bin/soffice.exe processes), but the request never ends. Finally I aborted the soffice.exe process and got some output.

<?php
header('Content-Type: text/plain; charset=utf-8');
$ubuntu = '"/usr/bin/python" "/var/www/unoconv" --format="pdf" --verbose --verbose --verbose "/var/www/test.odt" 2>&1';
$windows = '"C:\\Program Files (x86)\\LibreOffice 3.5\\program\\python.exe" "D:\\www\\unoconv" --format="pdf" --verbose --verbose --verbose "D:\\www\\test.odt" 2>&1';
echo shell_exec($windows);
exit;
?>

This result in $windows = "C:\Program Files (x86)\LibreOffice 3.5\program\python.exe" "D:\www\unoconv" --format="pdf" --verbose --verbose --verbose "D:\www\test.odt" 2>&1 creates the following output:

Office base location: C:\Program Files (x86)\LibreOffice 3.5
Office binary location: C:\Program Files (x86)\LibreOffice 3.5\program
Existing listener not found.
Launching our own listener using C:\Program Files (x86)\LibreOffice 3.5\program\soffice.exe.
LibreOffice listener successfully started. (pid=4208)
Verbosity set to level 2
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Failed to connect to C:\Program Files (x86)\LibreOffice 3.5\program\soffice.exe (pid=4208) in 6 seconds.
Connector : couldn't connect to socket (WSAECONNREFUSED, Connection refused)
Error: Unable to connect or start own listener. Aborting.
"

Do you have any idea what's the problem? Or maybe you could specify a range of problems, so I can check out things...

For me it seems to be a socket related problem. So does IIS require additional permissions here?

uno.RuntimeException: Binary URP bridge disposed during call

Hi,

I installed editors/openoffice-3 from the FreeBSD ports (Apache OpenOffice 3.4), under a recent FreeBSD-9 (Stable).

The path for pyuno.so:
/usr/local/openoffice-3.4.0/openoffice.org/basis3.4/program/pyuno.so

unoconv does not work yet.

I tried the tarball for unoconv-0.4. First I had to add in the extrapath glob.glob('/usr/local/openoffice*/openoffice.org/basis*/program')

After that it comes up with

~/unoconv-0.4/unoconv -f pdf -o ~/test.pdf ~/test.odt
Traceback (most recent call last):
File "/root/unoconv-0.4/unoconv", line 68, in
os.environ['LD_LIBRARY_PATH'] = oolibpath + os.pathsep + os.environ['LD_LIBRARY_PATH']
File "/usr/local/lib/python2.7/UserDict.py", line 23, in getitem
raise KeyError(key)
KeyError: 'LD_LIBRARY_PATH'

LD_LIBRARY_PATH isn't set.

Anyway, I tried to use the latest version checked out via Subversion.

~/svn/unoconv/trunk]//unoconv -f pdf -o ~/test.pdf ~/test.odt
unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
http://github.com/dagwieers/unoconv/issues

I wasn't successful with the extrapath addition as I did on unoconv-04. The error stays the same (Cannot find a suitable office..)

As a side node, I replaced "#!/usr/bin/python" with "#!/usr/bin/env python" (FreeBSD installs it under /usr/local/bin).

OpenOffice 3.4 and python 2.7 are compiled at the same time (same ports snapshot from last Friday, same gcc etc.) so python and pyuno.so should fit together.

Any ideas?

Regards
Peter

unoconv includes deleted text when converting from doc to txt

Hi!

When a .doc file with recorded changes is converted to a .txt, deleted text appears in the converted version. The same happens when using LibreOffice directly but a work around is to disable the "Show changes" option in LibreOffice menu. There is no such option with unoconv.

(This bug was originally reported to Debian BTS as bug #624295)

Not working on Mac

I get the following error on my macbook:

unoconv: Cannot find a suitable pyuno library and python binary combination in /Applications/OpenOffice.org.app/Contents
ERROR: Please locate this library and send your feedback to:
http://github.com/dagwieers/unoconv/issues
No module named uno
unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
http://github.com/dagwieers/unoconv/issues

I'm running OpenOffice.org 3.3.0 on Mac OS X Lion 10.7.2
My unoconv version is 0.5, it is placed in /usr/bin and given read and execute permissions

It fails if called directly, also if called with sudo

Searched for openoffice files and found:
pyuno.so at /Applications/OpenOffice.org.app/Contents/basis-link/program/pyuno.so
soffice.bin at /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin

Basic installation process

I'm trying to get unoconv up and running on a shell only Debian system. Do I need to install LibreOffice separately?

I've managed to install it using simple apt-get install unoconc, but when I try and run a command to convert a ppt to jpgs, I'm getting some "Format not supported" complaint. Example below:

:~/ppt-test# unoconv -f jpg my-file.ppt
unoconv: UnoException during conversion: URL seems to be an unsupported one.
The provided document cannot be converted to the desired format.

Maybe the basic command structure is simple wrong?

unoconv convert doc to pdf make error!

command:

unoconv -f pdf -p 2000 -o /opt/20125742228398c9fd7e4f-732e-4fc0-9748-55ca059481f5.pdf /opt/228398c9fd7e4f-732e-4fc0-9.doc

error:

Failed to connect to /opt/openoffice.org3/program/soffice.bin (pid=10757) in 6 seconds.
Connector : couldn't connect to socket (Success)
Error: Unable to connect or start own listener. Aborting.

unoconv not working

I have been trying to fix this issue for a long time now but unable to figure out the fix. Please help.
$ unoconv -f pdf presentation_39.ppt
unoconv: UnoException during conversion in <class 'main.com.sun.star.lang.IllegalArgumentException'>: Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""
Traceback (most recent call last):
File "/usr/bin/unoconv", line 790, in
main()
File "/usr/bin/unoconv", line 769, in main
convertor.convert(inputfn)
File "/usr/bin/unoconv", line 679, in convert
error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
File "/usr/lib/python2.7/dist-packages/uno.py", line 337, in uno_struct__getattr_
return builtin.getattr(self.dict["value"],name)
AttributeError: ErrCode

So, i downloaded unoconv-0.5.tar.bz2 from https://github.com/dagwieers/unoconv/downloads, and extracted it in my rails app's public folder. Then i got this error:
$ /home/kern/my_rails_app/public/unoconv-0.5/unoconv -f pdf presentation_39.ppt
UNO IllegalArgument during import phase: Source file cannot be read. Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""

Then i gave UNO_PATH= parameter as follows:
$ UNO_PATH=/usr/lib/libreoffice /home/kern/my_rails_app/public/unoconv-0.5/unoconv -f pdf presentation_39.ppt
UNO IllegalArgument during import phase: Source file cannot be read. Unsupported URL file:///home/kern/my_rails_app/public/data/presentation_39/presentation_39.ppt: ""
NOTE: i do not have libreoffice path at /opt/libreoffice3.5 as mentioned in #47
NOTE: I have tried the above with unoconv listener also as foolows:
$ unoconv --listener &
[1] 31574
$ ps -ef
root 31574 31503 3 07:27 pts/4 00:00:00 /usr/bin/python /usr/bin/unoconv --listener

The ppt file has 777 permissions as follows:
$ ls -l
total 260
-rwxrwxrwx 1 kern kern 258560 Jun 25 08:17 presentation_39.ppt

I have the following on my ubuntu 12.04 LTS 64-bit machine:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

$ apt-cache policy libreoffice
libreoffice:
Installed: 1:3.5.3-0ubuntu1
Candidate: 1:3.5.3-0ubuntu1

$ apt-cache policy unoconv
unoconv:
Installed: 0.4-1
Candidate: 0.4-1
NOTE: i have tried to search for libreoffice-pyuno or libobasis3.5-pyuno for which i get:
$ apt-cache policy libreoffice-pyuno
N: Unable to locate package libreoffice-pyuno
N: Couldn't find any package by regex 'libreoffice-pyuno'
NOTE: i have python-uno

Convert after launching listener

When calling "unoconv --listener --format=pdf file.odt" it'd be nice to start the listener (in case it does not exist, yet) and convert the file.

This might be related to issue #29 .

pyuno.so location not inserted into sys.path on Gentoo

This is Gentoo (64bits), and the configuration is as follows: We have

/usr/lib64/libreoffice/program/pyuno.so
/usr/lib64/libreoffice/program/soffice.bin

so we are only missing python.bin, which means an attempt to find an office returns a configuration with office.pythonhome set to None. Thus, nothing is ever inserted into sys.path (see that the only reference to sys.path is inside an if office.pythonhome statement) and uno cannot be imported later.

After inserting a line doing sys.path.insert(0, office.unopath) in the office_environ function everything was working fine for me. Maybe a case to consider in the code?

Issue using on webserver

Hi,

I installed latest version of libreoffice and 0.5 version of unoconv which is working perfectly while converting in command line interface, but not working when trying to invoke from PHP called from web-browser. I installed openoffice.org-pyuno.i386 and its dependencies for it to work.

But issue is when I restart the listener it does not start. Below is the error thrown

/usr/lib/openoffice.org3/program/soffice.bin X11 error: Can't open display:

My setup works perfectly until listener is restarted. Is the any way I can install openofice pyuno and it does not conflict with libreoffice.

Regards

Starting listener fails with "No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file"

Using Mac OS 10.6.8, LibreOffice 3.5.4.2, unoconv HEAD.

Trying to run listener fails with soffice.bin error:

$ unoconv -l -vvv
Verbosity set to level 3
DEBUG: sysname=posix, platform=darwin, python=/usr/bin/python, python-version=2.6.1 (r261:67515, Aug  2 2010, 20:10:18) 
[GCC 4.2.1 (Apple Inc. build 5646)]
DEBUG: Found pyuno.so in /Applications/LibreOffice.app/Contents/program
DEBUG: Found soffice.bin in /Applications/LibreOffice.app/Contents/program
DEBUG: Found unorc in /Applications/LibreOffice.app/Contents/ure-link/lib
DEBUG: Found OOoPython.framework/Versions/*/lib/python* in /Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/lib/python2.6
DEBUG: Found python in /Applications/LibreOffice.app/Contents/program
DEBUG: Considering /Applications/LibreOffice.app/Contents
DEBUG: -> Switching from /usr/bin/python to /Applications/LibreOffice.app/Contents/program/python
Verbosity set to level 3
DEBUG: sysname=posix, platform=darwin, python=/Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/OOoPython, python-version=2.6.1 (r261:67515, May 22 2012, 08:19:34) 
[GCC 4.0.1 (Apple Inc. build 5494)]
DEBUG: Found pyuno.so in /Applications/LibreOffice.app/Contents/program
DEBUG: Found soffice.bin in /Applications/LibreOffice.app/Contents/program
DEBUG: Found unorc in /Applications/LibreOffice.app/Contents/ure-link/lib
DEBUG: Found OOoPython.framework/Versions/*/lib/python* in /Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/lib/python2.6
DEBUG: Found python in /Applications/LibreOffice.app/Contents/program
DEBUG: Considering /Applications/LibreOffice.app/Contents
Using office base path: /Applications/LibreOffice.app/Contents
Using office binary path: /Applications/LibreOffice.app/Contents/program
Start listener on localhost:2002
2012-06-07 19:20:24.917 soffice.bin[90935:903] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
Existing LibreOffice listener found, nothing to do.

Similar error without starting listener:

$ unoconv -vvv test.emf 
Verbosity set to level 3
DEBUG: sysname=posix, platform=darwin, python=/usr/bin/python, python-version=2.6.1 (r261:67515, Aug  2 2010, 20:10:18) 
[GCC 4.2.1 (Apple Inc. build 5646)]
DEBUG: Found pyuno.so in /Applications/LibreOffice.app/Contents/program
DEBUG: Found soffice.bin in /Applications/LibreOffice.app/Contents/program
DEBUG: Found unorc in /Applications/LibreOffice.app/Contents/ure-link/lib
DEBUG: Found OOoPython.framework/Versions/*/lib/python* in /Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/lib/python2.6
DEBUG: Found python in /Applications/LibreOffice.app/Contents/program
DEBUG: Considering /Applications/LibreOffice.app/Contents
DEBUG: -> Switching from /usr/bin/python to /Applications/LibreOffice.app/Contents/program/python
Verbosity set to level 3
DEBUG: sysname=posix, platform=darwin, python=/Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/OOoPython, python-version=2.6.1 (r261:67515, May 22 2012, 08:19:34) 
[GCC 4.0.1 (Apple Inc. build 5494)]
DEBUG: Found pyuno.so in /Applications/LibreOffice.app/Contents/program
DEBUG: Found soffice.bin in /Applications/LibreOffice.app/Contents/program
DEBUG: Found unorc in /Applications/LibreOffice.app/Contents/ure-link/lib
DEBUG: Found OOoPython.framework/Versions/*/lib/python* in /Applications/LibreOffice.app/Contents/program/OOoPython.framework/Versions/2.6/lib/python2.6
DEBUG: Found python in /Applications/LibreOffice.app/Contents/program
DEBUG: Considering /Applications/LibreOffice.app/Contents
Using office base path: /Applications/LibreOffice.app/Contents
Using office binary path: /Applications/LibreOffice.app/Contents/program
DEBUG: Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /Applications/LibreOffice.app/Contents/program/soffice.bin.
LibreOffice listener successfully started. (pid=91159)
2012-06-07 19:27:01.150 soffice.bin[91159:903] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
DEBUG: Process /Applications/LibreOffice.app/Contents/program/soffice.bin (pid=91159) exited with 1.
Error: Unable to connect or start own listener. Aborting.

How can I debug this issue?

Unable to run unoconv from PHP

I've checked as many of the similar errors as I can, but nothing seems to match.

I have installed LibreOffice3.4 on RHEL5. I was unable to install unoconv via RPM or YUM so have used the SVN file and set it up manually. I can convert files via the command line without issue. It works well converting just about any format to PDF.

When I try to run the same command from PHP it just fails. I captured its output and the error is 'Cannot find a suitable pyuno library and python binary combination in /opt/libreoffice3.4' and '(RuntimeException):cannot open file:///root/.ure/types.rdb unoconv: Cannot find a suitable office installation on your system'.

PHP is running under Apache so shouldn't it be looking in the Apache home directory for files? And if so why is it trying to use root? Perhaps my manual setup is missing something? Or is there something I am unaware of in Apache?

For unoconv I didn't really do anything except place the file in /usr/bin. It will run from the command line whether I just enter unoconv or the full path to it. I can't log in as Apache to test if it would work or not.

Any pointers or advice?

Cheers!

Exception if file doesn't exist

I'm using unoconv 0.4 and if I want to convert a file which doesn't exist I get an exception:

unoconv /tmp/test.odt

Will give me:

unoconv: file `/tmp/test.odt' does not exist.
unoconv: UnoException during conversion in <class 'main.com.sun.star.lang.IllegalArgumentException'>: URL seems to be an unsupported one.
Traceback (most recent call last):
File "/usr/bin/unoconv", line 790, in
main()
File "/usr/bin/unoconv", line 769, in main
convertor.convert(inputfn)
File "/usr/bin/unoconv", line 679, in convert
error("ERROR: The provided document cannot be converted to the desired format. (code: %s)" % e.ErrCode)
File "/usr/lib/python2.7/dist-packages/uno.py", line 320, in uno_struct__getattr_
return builtin.getattr(self.dict["value"],name)
AttributeError: ErrCode

This exception prevents unoconv from closing successfully OpenOffice. I still have oosplash.bin and soffice.bin in the background open which will prevent OpenOffice to start a new instance.

Integrate with FilterFactory for filter details

Instead of integrating a static list of filters, we definitely should using the FilterFactory service to query the available filters and extensions. The office instance knows best what filters can do, and some filters come and go.

Converting filenames with non-ascii characters (ErrCode 2074)

As I am trying to export doc files to jpeg I get the following error.

I have restarted all my instances of openoffice, reinstalled everything, but still the same issue.
Any idea what the reason is as I am on a dead end

Input file: EWAD-CZ_press_release.doc
Selected output format: Joint Photographic Experts Group [.jpg]
Selected ooffice filter: draw_jpg_Export
Used doctype: graphics
unoconv: UnoException during conversion in <class __main__.com.sun.star.task.ErrorCodeIOException at 0x7f1e302f0590>:
ERROR: The provided document cannot be converted to the desired format. (code: 2074)

Configuration of LibreOffice is changed

I'm using unoconv 0.4 and LibreOffice 3.4.4. Normally I have Writer maximized but if I convert a document with unoconv Writer is at the next start not maximized anymore. The conversion has something changed at the settings of Writer.

unoconv: UnoException during conversion

unoconv don't convert anymore:

$ unoconv -f pdf index.html
unoconv: UnoException during conversion in <class 'main.com.sun.star.task.ErrorCodeIOException'>:
ERROR: The provided document cannot be converted to the desired format. (code: 1287)

What can it be?

Some information:

.......................................................................................................................

$ unoconv --version
unoconv 0.4
Written by Dag Wieers [email protected]
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux2
python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5]

build revision $Rev$

.......................................................................................................................

$ cat /etc/issue
Debian GNU/Linux 6.0

.......................................................................................................................

$ dpkg -l|grep libreoffice
ii libreoffice-base-core 1:3.3.2-3 office productivity suite -- shared library
ii libreoffice-common 1:3.3.2-3 office productivity suite -- arch-independent files
ii libreoffice-core 1:3.3.2-3 office productivity suite -- arch-dependent files
ii libreoffice-draw 1:3.3.2-3 office productivity suite -- drawing
ii libreoffice-filter-binfilter 1:3.3.2-3 office productivity suite -- legacy filters (e.g. StarOffice 5.2)
ii libreoffice-impress 1:3.3.2-3 office productivity suite -- presentation
ii libreoffice-java-common 1:3.3.2-3 office productivity suite -- arch-independent Java support files
ii libreoffice-math 1:3.3.2-3 office productivity suite -- equation editor
ii libreoffice-style-galaxy 1:3.3.2-3 office productivity suite -- Galaxy (Default) symbol style
ii libreoffice-writer 1:3.3.2-3 office productivity suite -- word processor
ii libreoffice-writer2latex 1.0.2-5 Writer/Calc to LaTeX converter extension for LibreOffice
ii libreoffice-writer2xhtml 1.0.2-5 Writer/Calc to XHTML converter extension for LibreOffice

.......................................................................................................................

$ ps axu | grep soffice
1007 3216 0.0 0.0 7536 844 pts/5 S+ 14:17 0:00 grep soffice
root 9107 0.0 0.9 478388 29772 ? Sl Apr28 0:35 /usr/lib/libreoffice/program/soffice.bin -headless -invisible -nocrashreport -nodefault -nologo -nofirststartwizard -norestore -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
1007 29319 0.0 0.0 324340 2408 ? Sl Apr30 0:15 /usr/lib/libreoffice/program/soffice.bin --versio -splash-pipe=5

.......................................................................................................................

Change/force the document encoding during conversion (UTF-8)

This functionality already exists for certain import/export filters. Since this heavily depends on the filter and filter options, we cannot generalize this for all the document formats. Also, conversion of encoding only works if you know exactly what you are importing, and that's not something we can detect easily.

If you need more information on how to influence import and export filters using the -i / --import and -e / --export options, look at the man page and the information from: https://github.com/dagwieers/unoconv/blob/master/docs/filters.txt

Launching with single/double hyphen

I just saw, unoconv is starting LibreOffice using double hyphen and OpenOffice.org using single hyphen.

But on lines 880 and 910 you still start both using single hyphen.

I'm not sure if this is a bug, but see it as "notice" ;-) ...

com.sun.star.beans.PropertyValue may not yet been imported when Options initializing

com.sun.star.beans.PropertyValue may not yet been imported when Options initializing.
git diff to fix it:

diff --git a/unoconv b/unoconv
index a4fa0d0..ba001ff 100755
--- a/unoconv
+++ b/unoconv
@@ -196,8 +196,7 @@ def python_switch(office):

     os.environ['UNO_PATH'] = office.unopath

-    if op.verbose > 0:
-        print >>sys.stderr, "Switching from python %s to %s" % (sys.executable, office.python)
+    #print >>sys.stderr, "Switching from python %s to %s" % (sys.executable, office.python)
     os.execvpe(office.python, [office.python, ] + sys.argv[0:], os.environ)

 class Fmt:
@@ -882,8 +881,6 @@ def main():
 if __name__ == '__main__':
     exitcode = 0

-    op = Options(sys.argv[1:])
-
     for of in find_offices():
         if sys.executable != of.python:
            python_switch(of)
@@ -923,6 +920,8 @@ if __name__ == '__main__':
         def flush( self ):
             pass

+    op = Options(sys.argv[1:])
+
     try:
         main()
     except KeyboardInterrupt, e:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.