Skip to main content
Version: 7.x

LibreOffice

The LibreOffice module interacts with LibreOffice to convert documents to PDF, thanks to unoconv.

Properties

--libreoffice-disable-routes bool  Disable the routes
--unoconv-disable-listener bool Do not start a unoconv listener - save resources in detriment of performance
info

If --unoconv-disable-listener is set to true, Gotenberg starts a dedicated LibreOffice instance for each conversion. It also impacts the performance of the unoconv PDF engine.

Route

POST /forms/libreoffice/convert

This route accepts multipart/form-data requests and files with the following extensions:

.bib  .doc  .xml  .docx  .fodt  .html  .ltx  .txt  .odt  .ott  .pdb  .pdf  .psw  .rtf  .sdw  .stw  .sxw  .uot  .vor  .wps  .epub  .png  .bmp  .emf  .eps  .fodg  .gif  .jpg  .met  .odd  .otg  .pbm  .pct  .pgm  .ppm  .ras  .std  .svg  .svm  .swf  .sxd  .sxw  .tiff  .xhtml  .xpm  .fodp  .potm  .pot  .pptx  .pps  .ppt  .pwp  .sda  .sdd  .sti  .sxi  .uop  .wmf  .csv  .dbf  .dif  .fods  .ods  .ots  .pxl  .sdc  .slk  .stc  .sxc  .uos  .xls  .xlt  .xlsx  .tif  .jpeg  .odp

For instance:

curl \
--request POST 'http://localhost:3000/forms/libreoffice/convert' \
--form 'files=@"/path/to/file.docx"' \
-o my.pdf
curl \
--request POST 'http://localhost:3000/forms/libreoffice/convert' \
--form 'files=@"/path/to/file.docx"' \
--form 'files=@"/path/to/file.xlsx"' \
-o my.zip
landscape bool  Set the paper orientation to landscape (default false)

For instance:

curl \
--request POST 'http://localhost:3000/forms/libreoffice/convert' \
--form 'files=@"/path/to/file.docx"' \
--form 'landscape="true"' \
-o my.pdf

Metrics

The LibreOffice module exposes the following metrics:

  • {namespace}_unoconv_active_instances_count - current number of active unoconv instances.
  • {namespace}_unoconv_listener_active_instances_count - current number of active unoconv listener instances.
  • {namespace}_unoconv_listener_queue_length - current number of processes in the queue.

See Prometheus for more details.