Containerized REST API for the conversion of Office files to PDF using LibreOffice
2.8K
This repository contains a simple containerized API to convert Office documents to PDF documents using LibreOffice headless.
The code source is available on GitHub.
By default, the container listens on port 3000. The port is configurable using the PORT environment variable.
All requests must by send in POST to the /convert endpoint with a multipart/form-data content type. The request must contain an Office file with the key file.
The server returns 200 if the conversion was successful and the images are available in the response body. In case of error, the server returns a 400 status code with a JSON object containing the error message (format: {error: string}).
docker run -p "3000:3000" codeinchq/office2pdf
curl -X POST -F "file=@/path/to/file.docx" http://localhost:3000/convert -o example.pdf
A health check is available at the /health endpoint. The server returns a status code of 200 if the service is healthy, along with a JSON object:
{ "status": "up" }
A PHP 8 client is available at on GitHub and Packagist.
This project is licensed under the MIT License - see the LICENSE file for details.
Content type
Image
Digest
sha256:dba59a2c9…
Size
398.1 MB
Last updated
almost 2 years ago
docker pull codeinchq/office2pdf