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

Has anyone had any luck integrating with Libreoffice 6.2.x or 6.3.x in a Linux environment? #46

Open
ngaldridge opened this issue Aug 30, 2019 · 14 comments
Labels
P: Low S: on hold The issue is on hold until further notice T: question A question that does not match a bug or feature request

Comments

@ngaldridge
Copy link

ngaldridge commented Aug 30, 2019

Hi,

Has anyone had any luck integrating with a Libreoffice 6.2.x or 6.3.x in a linux environment?

I set PYTHONPATH="/usr/lib/libreoffice/program" so that Carbone can find Uno, but I get some strange errors when Carbone's converter.py is attempting to import from com.sun.star...

When I run the test program with Nodejs debug turned on, i get:

  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +109ms
  carbone:converter process Python of factory 0 died 1 +4ms
  carbone:converter process Office of factory 0 died null +70ms
  carbone:converter factory 0 is completely off +0ms
  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +101ms
  carbone:converter process Python of factory 0 died 1 +4ms
  carbone:converter process Office of factory 0 died null +289ms
  carbone:converter factory 0 is completely off +0ms
  carbone:converter python stderr : Traceback (most recent call last):
  File "/usr/local/dcs/node_modules/carbone/lib/converter.py", line 9, in <module>
    from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
  File "/usr/lib/libreoffice/program/uno.py", line 434, in _uno_import
    raise uno_import_exc
  File "/usr/lib/libreoffice/program/uno.py", line 356, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.document.UpdateDocMode.QUIET_UPDATE' is unknown)
 +99ms
  carbone:converter process Python of factory 0 died 1 +3ms

Thanks in advance for any advice!

Cheers,

Nathan

@dgrelaud
Copy link
Member

dgrelaud commented Sep 2, 2019

Hi,

How did you install LibreOffice?
We strongly recommend using this method: https://github.com/Ideolys/carbone#on-ubuntu-server--ubuntu-desktop
This LibreOffice installation method contains everything Carbone needs.

We have some Ubuntu 18.04 LTS servers running successfully with the version 6.3.0.4. Here is the link: http://downloadarchive.documentfoundation.org/libreoffice/old/6.3.0.4/deb/x86_64/LibreOffice_6.3.0.4_Linux_x86-64_deb.tar.gz

Best regards,
David.

@ngaldridge
Copy link
Author

So, I'm running on Alpine and thus the only binary installs are from the Alpine repo. I guess there's something interesting going on with the Python/LO library integration that I haven't figured out yet.

@viincenb
Copy link
Contributor

viincenb commented Sep 3, 2019

I’ve already tried to run Carbone in Alpine for a Docker image, but many things were missing and I didn’t succeed. Good luck with it, it’s hard 😄

@ngaldridge
Copy link
Author

Ok - I got one run out of it (docker/alpine) - I figured out how the python/libreoffice binding works (at least enough to be dangerous).

I need to do a few more tests now to see if I've really got it.

@ngaldridge
Copy link
Author

So, I have succeeded in figuring out how to integrate with 6.2.x and 6.3.x in Alpine (in Docker). Feel free to contact me if you would like to know what I had to do.

Cheers!

Nathan

@pdittaro
Copy link

@ngaldridge I would be interested in this. Are you able to send a gist of your Dockerfile?

@steevepay steevepay added P: Low S: on hold The issue is on hold until further notice T: question A question that does not match a bug or feature request labels Oct 8, 2019
@steevepay
Copy link
Member

Hi,

We are investigating the idea again, we will come back to you.

@fleebzz
Copy link

fleebzz commented Oct 17, 2019

Hi @pdittaro

You can take a look at carbone-docker if you want a packaged Docker image with a Carbone API exposed. (Upgraded to LibreOffice 6.3.3.1 this morning).

You also could be interested in carbone-connect to have a similar Carbone JS API with some improvements (Promises and Streams).

@loneil
Copy link

loneil commented Dec 17, 2019

So, I have succeeded in figuring out how to integrate with 6.2.x and 6.3.x in Alpine (in Docker). Feel free to contact me if you would like to know what I had to do.

Cheers!

Nathan

@ngaldridge would you be able to share your Alpine solution? I've got it working with @fleebzz's carbone-docker container (and using newer node images than the 8 one in there), but interested in seeing your Alpine one as well if available. Thanks.

@karimkawambwa
Copy link

karimkawambwa commented Jun 10, 2022

bcgov/alpine-node-libreoffice#7

I am running into an almost similar issue but the Office is the one that dies.

Anyone with a solution ?
I don't have much details to go with but died 1

carbone-lambda_1  | 2022-06-10T14:41:16.622Z carbone:converter process Office of factory 0 died 1
carbone-lambda_1  | 2022-06-10T14:41:16.626Z carbone:converter process Python of factory 0 died null
carbone-lambda_1  | 2022-06-10T14:41:16.627Z carbone:converter factory 0 is completely off

@adussarps
Copy link

adussarps commented Oct 21, 2023

ngaldridge Hi there, could you share the install instruction on docker alpine 🙏 ?
It would be of a great help :)!

@enxoco
Copy link

enxoco commented Oct 23, 2024

For anyone who may still be trying to get this running in Docker, I recently got this working for a project using node:20-bulleyes-slim. Here is an example Dockerfile that works. The code included is based on the example code. The project README describes how you can test it out. Hopefully this is helpful for someone as I spent about 2-3 days banging my head against a wall trying to get this to work properly.

@fleebzz
Copy link

fleebzz commented Oct 28, 2024

After a long time without update I pushed two new versions of carbone-docker with some major upgrades:

Both versions include these upgrades :

Simplest way to integrate this Docker image is to use carbone-connect to have a similar Carbone JS API that will use a remote Carbone instance and with some improvements (Promises and Streams).

@steevepay
Copy link
Member

Hello @fleebzz,

For the past year, we've been publishing the latest versions of the Carbone Cloud API as containers on Docker Hub, which you can use for free: Docker Hub - Carbone.

You'll have access to the latest Carbone version 4, featuring LibreOffice 24.8, with or without all fonts pre-installed. By default, it doesn't include enterprise features (such as dynamic pictures, charts, barcodes, etc.). To enable these features, please contact the Carbone team at [email protected].

When the server starts, you can interact with the following endpoints (the same as the Carbone Cloud API):

  • POST /template: Upload a template and receive a templateID
  • GET /template/: Download a template
  • DELETE /template/: Delete a template
  • POST /render/: Generate a document and receive a unique renderID
  • GET /render/: Download the generated document

To easily interact with the Carbone Server, you can use one of our pre-made SDKs for Javascript, Node, Golang, PHP, and more: Carbone SDKs.

Here is the documentation for Carbone Docker, where you'll find options and configurations (such as storing templates in S3 or Azure).

Important announcement: We are excited to share that we will be releasing Carbone v5 as a Docker container in the coming days. This new version includes an even more efficient engine, numerous bug fixes, and a new DOCX to PDF converter that offers improved accuracy and rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: Low S: on hold The issue is on hold until further notice T: question A question that does not match a bug or feature request
Projects
None yet
Development

No branches or pull requests

10 participants