Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where is TEMPLATED_DOCS_LIBREOFFICE_PATH for MAC? #9

Open
Kopei opened this issue Feb 19, 2017 · 5 comments
Open

where is TEMPLATED_DOCS_LIBREOFFICE_PATH for MAC? #9

Kopei opened this issue Feb 19, 2017 · 5 comments

Comments

@Kopei
Copy link

Kopei commented Feb 19, 2017

  • 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?
@alexmorozov
Copy link
Owner

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
Copy link
Owner

A relevant ticket to track: xrmx/pylokit#10

@zontarian
Copy link

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 :)

@alexmorozov
Copy link
Owner

@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.

@zontarian
Copy link

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants