# Document conversion with Collabora REST API

**URL:** <https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686>\
**Category:** User Support\
**Created:** [October 27, 2021, 3:34pm UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686 "2021-10-27T15:34:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hal-berto](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@hal-berto](https://forum.collaboraonline.com/u/hal-berto)\
**Post date:** [October 27, 2021, 3:34pm UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686/1 "2021-10-27T15:34:01Z")

</div>

Greetings,  
I’m currently developing a module that takes care of convert .docx documents into .PDF documents.  
The conversion is done calling Collabora online REST APIs ([Conversion API — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/conversion_api.html))  
The process works well if I want to obtain “normal” PDF documents, but I’m not able to find a more detailed documentation of possible parameters that can be sent to the REST API. In the specific what I’d like to know is:  
Is it possible to convert .docx documents in a read-only PDF (PDF type A)?

---

<div class="post-metadata">

**Author:** ![gmasei11](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@gmasei11](https://forum.collaboraonline.com/u/gmasei11)\
**Post date:** [November 11, 2021, 11:58am UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686/2 "2021-11-11T11:58:46Z")

</div>

Hi @hal-berto,

There is no defined parameter for this but I implemented something on our custom version and I can push the implementation into community repository. It can be used as follows:

curl -F “data=@Test67.odt” -F “PDFVer=PDF/A-2b” [http://localhost:9980/lool/convert-to/pdf](http://localhost:9980/lool/convert-to/pdf)

If your interested and patient, I can share this in the following days. BTW, which version are you using ?

---

<div class="post-metadata">

**Author:** ![hal-berto](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@hal-berto](https://forum.collaboraonline.com/u/hal-berto)\
**Post date:** [November 16, 2021, 8:31am UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686/3 "2021-11-16T08:31:31Z")

</div>

Hi @gmasei11 ,  
that’s seems to be a perfect solution.  
Version of collabora I’m currently using is:

### LOOLWSD

6.4.9 (git hash: [3ae382d])

Sul server: [ae8660ec])

### LOKit

Collabora Office 6.4-39 (git hash: [2f8a1c8])

“Ubuntu 18.04.5 LTS”

---

<div class="post-metadata">

**Author:** ![pedro.silva](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/pedro.silva/32/4_2.png) [@pedro.silva](https://forum.collaboraonline.com/u/pedro.silva)\
**Post date:** [November 25, 2021, 10:49am UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686/4 "2021-11-25T10:49:19Z")

</div>

Thanks @gmasei11 for the PR on gerrit [https://gerrit.libreoffice.org/c/core/+/125255](https://gerrit.libreoffice.org/c/core/+/125255) !

---

<div class="post-metadata">

**Author:** ![gmasei11](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@gmasei11](https://forum.collaboraonline.com/u/gmasei11)\
**Post date:** [December 15, 2021, 1:10pm UTC](https://forum.collaboraonline.com/t/document-conversion-with-collabora-rest-api/686/5 "2021-12-15T13:10:16Z")

</div>

@hal-berto The parameter was included in [6.4](https://github.com/CollaboraOnline/online/commit/d834f842c379558cbbbd05db5ea9e116f9b36d89) and [21](https://github.com/CollaboraOnline/online/commit/9c4bfaaff1c460b5291f37b042d01030d1a058e8). In order to use it you can build the desired version or wait for the next release.

The parameter supports the following values, depending on the **Core** version on which **Online** is based:

- 6.4: **PDF/A-1b** , **PDF/A-2b** , **PDF-1.5** , **PDF-1.6**

- 21: **PDF/A-1b** , **PDF/A-2b** , **PDF/A-3b** , **PDF-1.5** , **PDF-1.6**

**Note**

When using **PDF/A-1b** the resulted PDF can have sometimes the **PDF/A-1a** version. For understanding why this is happening please refer to [https://bugs.documentfoundation.org/show\_bug.cgi?id=140759](https://bugs.documentfoundation.org/show_bug.cgi?id=140759)
