templated-docs icon indicating copy to clipboard operation
templated-docs copied to clipboard

where is TEMPLATED_DOCS_LIBREOFFICE_PATH for MAC?

Open Kopei opened this issue 8 years ago • 5 comments

  • Templated-docs version: 0.3.1
  • Python version: 3.5
  • Operating System: osx 10.12
  • OpenOffice5.3

Description

Hi, I am trying to test this package on local mac machine. I found that it needs pylokit from pylokit import Office But it seems pylokit only support linux. [https://github.com/xrmx/pylokit/blob/master/pylokit/lokit.py]

What I Did

I am trying add:
`/Applications/OpenOffice.app/Contents/program` in TEMPLATED_DOCS_LIBREOFFICE_PATH,
but there are no `TARGET_LIB = ("libsofficeapp.so", "libmergedlo.so")`,
in mac, there is only  `libsofficeapp.dylib`.
I do not know how to set TEMPLATED_DOCS_LIBREOFFICE_PATH for environment var.
Any suggestions?

Kopei avatar Feb 19 '17 10:02 Kopei

Hi! As far as I know, LibreOfficeKit (the LibreOffice bridge to interface it from within other programs) works only on Linux. If you have some evidence LibreOfficeKit works on Macs too, please let me know. I think, we could ask pylokit's author then to incorporate the OSX support into the library.

alexmorozov avatar Feb 20 '17 09:02 alexmorozov

A relevant ticket to track: https://github.com/xrmx/pylokit/issues/10

alexmorozov avatar Feb 20 '17 09:02 alexmorozov

Please note that LibreOfficeKit is needed only to convert from one format to another, i.e. from odt to docx/pdf or such. If you don't need this, the template engine works. Then, if you are on mac OSX, as a workaround, you can use either UNO or simply invoke

/Applications/MACOSXpath/soffice --invisible --headless --convert-to pdf --outdir /tmp/spool <FILENAME>

with a dirty system call :)

zontarian avatar Apr 07 '17 10:04 zontarian

@zontarian thanks for a tip! You're absolutely right. If there's no need to convert a document to another format, we don't even try to mess with that LOKit stuff.

As a side note - we have a project running against an UNO-based solution. It mostly works, though it's much slower and crashes randomly several times a month, so we have to have a sentinel in place. Command-line approach works great for ad-hoc operations, since the cold LibreOffice startup takes too much time for a web-based solution.

Just my two cents.

alexmorozov avatar Apr 07 '17 10:04 alexmorozov

@alexmorozov you are right. We too experimented with UNO for performance issues, but in the end, for one off requests, the difference in time was not noticeable, and the stability of a direct invokation is greater.

But in the end we will deploy to Linux, so we are just using this kludge to be able to develop and test on MacOSX. Great work, thanks!

zontarian avatar Apr 07 '17 10:04 zontarian