# Libreoffice online vs calling libreoffice headless

**URL:** <https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375>\
**Category:** Uncategorized\
**Created:** [May 17, 2021, 10:01am UTC](https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375 "2021-05-17T10:01:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![osamacollabora](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@osamacollabora](https://forum.collaboraonline.com/u/osamacollabora)\
**Post date:** [May 17, 2021, 10:01am UTC](https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375/1 "2021-05-17T10:01:03Z")

</div>

Hello, I have been searching a lot for the right way to use Libreoffice for the purpose of converting word documents to pdf documents from within a php application in windows server. What I found is the following:

1. Simply call libreoffice headless from php “exec” command, for example  
soffice --headless --convert-to pdf abc.docx --outdir ./my\_files … etc
2. Using unoconv  
[unoconv · PyPI](https://pypi.org/project/unoconv/)
3. Using Libreoffice online from Collaboraonline

I tried the first approach and it is working fine. So, I’m not sure why should I go with approach 2 or 3. What is the right approach to use? Is it just a matter of convenience? or there are concrete reasons behind which option to use (such as parallel requests, scalability, etc)  
I read the information in the following page, but I really need more elaboration

> **[Document conversion with Collabora Online, JODConverter and unoconv -...](https://www.collaboraoffice.com/document-conversion/)**
>
> JODConverter (for Java OpenDocument Converter) is a widely used tool that automates document conversions. unoconv is a Python tool with a similar purpose. You can read here details about why you should consider switching to JODConverter’s Collabora...

The second part of my question, how can I use Libreoffice online from within php web application using apache server installed via xampp?

Thanks

---

<div class="post-metadata">

**Author:** ![mmeeks](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/mmeeks/32/371_2.png) [@mmeeks](https://forum.collaboraonline.com/u/mmeeks)\
**Post date:** [May 18, 2021, 12:33pm UTC](https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375/2 "2021-05-18T12:33:46Z")

</div>

> I tried the first approach and it is working fine.  
> So, I’m not sure why should I go with approach 2 or 3.

Good question; there are lots of reasons; lets list a few:

- **security** - COOL will isolate each document in a chroot, so something bad - a macro, or script, or exploit will not be able to escape and damage your machine or leak other document data
- **reliability / lifecycle management** - sometimes libreoffice can hand on load, or hit some corner-case of throwing up a dialog that was un-anticipated. COOL will time such documents out after a configurable period and fail cleanly for you.
- **performance** - and parallel processing. A local libreoffice process is single threaded, and will only process one request at a time. It is possible to work around this, and write extra code to manage a pool of processes - but it is a real pain, and like anything threaded - problematic to get right - COOL does that all already for you
- **memory efficiency** - COOL works hard to share memory between parallel documents, it will be far cheaper than running multiple parallel libreoffice processes.
- **manage-ability** with a very simple REST convert-to interface, you can easily deploy and manage docker containers for COOL and host those on a different machine - or behind a **high availability / load balancer** for larger setups. You can manage and see the cost of that workload by itself easily separated from the web workload.
- **support/SLA** - ok so a gratuitous commercial plug - but some people really want that for their deployments so they can be confident in availability. Its there as an option with COOL.

Inevitably I’ll think of some more when I hit sent, but I hope that helps.

---

<div class="post-metadata">

**Author:** ![osamacollabora](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@osamacollabora](https://forum.collaboraonline.com/u/osamacollabora)\
**Post date:** [May 19, 2021, 8:57am UTC](https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375/3 "2021-05-19T08:57:49Z")

</div>

Thanks for the reply, I will try to grasp all the ideas in your reply. However, may you answer the second part of my question which was:

how can I use Libreoffice online from within php web application using apache server installed via xampp?

Thanks again

---

<div class="post-metadata">

**Author:** ![bearon](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@bearon](https://forum.collaboraonline.com/u/bearon)\
**Post date:** [May 31, 2021, 5:38am UTC](https://forum.collaboraonline.com/t/libreoffice-online-vs-calling-libreoffice-headless/375/4 "2021-05-31T05:38:21Z")

</div>

You could check out the [SDK](https://sdk.collaboraonline.com/) page for examples.
