Conversion API

Collabora Online allows you to convert between various file formats easily. To do so, all you need to do is to HTTP POST the content of the file to the specific endpoint.

API: HTTP POST to /lool/convert-to/<format>

  • the format is e.g. png, pdf or txt

  • the file itself in the payload

    Example:

curl -F "data=@test.txt" https://localhost:9980/lool/convert-to/docx > out.docx
  • or in HTML:

1
2
3
4
<form action="https://localhost:9980/lool/convert-to/docx" enctype="multipart/form-data" method="post">
 File: <input type="file" name="data"><br/>
 <input type="submit" value="Convert to DOCX">
</form>

Alternatively you can omit the <format>, and instead provide it as another parameter

Example:

curl -F "data=@test.odt" -F "format=pdf" https://localhost:9980/lool/convert-to > out.pdf
  • or in HTML:

1
2
3
4
5
<form action="https://localhost:9980/lool/convert-to" enctype="multipart/form-data" method="post">
 File: <input type="file" name="data"><br/>
 Format: <input type="text" name="format"><br/>
 <input type="submit" value="Convert">
</form>