Sign inSign up

molandev/libreoffice-converter-api

By molandev

•Updated 6 months ago

HTTP API service (port 10996) using LibreOffice to convert DOC to DOCX, PDF and more formats

Image
0

398

molandev/libreoffice-converter-api repository overview

⁠LibreOffice Converter Service - Overview

ā šŸ“¦ Source Code

ā šŸš€ What Is It?

A powerful, cloud-native document format conversion service powered by GraalVM Native Image and LibreOffice. Built for versatile document transformation with minimal resource consumption, it converts between 100+ document formats effortlessly.

⁠✨ Core Features

ā šŸ”„ Versatile Format Conversion
  • LibreOffice Engine: Industry-standard document conversion
  • 100+ Formats: DOC, DOCX, PDF, XLS, XLSX, PPT, PPTX, HTML, and more
  • Stream Processing: Handles large files without OOM errors
ā šŸ›”ļø Production-Ready Reliability
  • Smart Concurrency Control: Semaphore-based rate limiting prevents system overload
  • Auto-Cleanup Mechanism: Scheduled task automatically purges temporary files
  • Graceful Degradation: Queuing mechanism with configurable timeouts
ā šŸŽÆ Developer-Friendly API
  • Dual Input Modes: Upload files directly or provide URLs
  • RESTful Design: Clean endpoints with proper HTTP status codes
  • Chinese Filename Support: URL-encoded headers for international compatibility

ā šŸ“¦ Supported Conversions

FromToBest For
DOCDOCX, PDFLegacy Word document modernization
DOCXPDF, HTMLDocument sharing & publishing
XLSXLSX, PDFExcel spreadsheet conversion
XLSXPDF, CSVReport generation
PPTPPTX, PDFPowerPoint presentation conversion
PPTXPDFPresentation sharing
Any LibreOffice FormatPDFUniversal document output

ā šŸŽ® Quick Start

⁠Pull from Docker Hub
docker pull molandev/libreoffice-converter-api:latest
⁠Run in Seconds
docker run -d \
  --name libreoffice-converter \
  -p 10996:10996 \
  -v /data/temp:/app/temp \
  -e CONVERTER_MAX_CONCURRENT=10 \
  -e CONVERTER_RETENTION_MINUTES=10 \
  molandev/libreoffice-converter-api:latest
ā šŸ“š API Documentation

Access the complete API guide at: http://localhost:10996/help

⁠Convert Your First Document
# Convert DOC to DOCX
curl -F "[email protected]" \
     -F "format=docx" \
     http://localhost:10996/convert/libreoffice/upload \
     -o output.docx

# Convert DOCX to PDF
curl -F "[email protected]" \
     -F "format=pdf" \
     http://localhost:10996/convert/libreoffice/upload \
     -o output.pdf

# Convert via URL
curl -X POST "http://localhost:10996/convert/libreoffice/url?fileUrl=https://example.com/doc.docx&format=pdf" \
     -o output.pdf

# Convert Excel to PDF
curl -F "[email protected]" \
     -F "format=pdf" \
     http://localhost:10996/convert/libreoffice/upload \
     -o output.pdf

ā āš™ļø Configuration

ParameterDefaultDescription
CONVERTER_MAX_CONCURRENT10Max parallel conversions
CONVERTER_RETENTION_MINUTES10Temp file retention
CONVERTER_SCHEDULE_MINUTES5Cleanup interval
SERVER_PORT10996Service port

ā šŸ”§ Advanced Usage

⁠High-Concurrency Setup
docker run -e CONVERTER_MAX_CONCURRENT=20 \
           -e CONVERTER_ACQUIRE_TIMEOUT=60 \
           molandev/libreoffice-converter-api:latest
⁠Minimal Resource Environment
docker run -e CONVERTER_MAX_CONCURRENT=3 \
           -e CONVERTER_RETENTION_MINUTES=5 \
           molandev/libreoffice-converter-api:latest

ā šŸ’” Why Choose This?

āœ… Zero JVM Warmup - GraalVM Native means instant peak performance
āœ… 100+ Format Support - LibreOffice handles virtually any document format
āœ… Production-Ready - Smart concurrency control & auto-cleanup
āœ… Cloud-Native - Docker-first design, Kubernetes-ready
āœ… Battle-Tested Engine - LibreOffice is the industry standard for document conversion

ā šŸŽÆ Perfect For

  • Legacy Document Modernization: Convert old DOC files to modern DOCX format
  • Document Publishing: Transform any format to PDF for universal sharing
  • Report Generation: Convert Excel spreadsheets to PDF reports
  • Content Migration Projects: Batch convert documents between formats
  • SaaS Applications: Multi-tenant document processing

ā šŸ“‹ Common Use Cases

⁠DOC to DOCX (Legacy Modernization)
curl -F "[email protected]" -F "format=docx" \
     http://localhost:10996/convert/libreoffice/upload -o modern.docx
⁠DOCX to PDF (Document Sharing)
curl -F "[email protected]" -F "format=pdf" \
     http://localhost:10996/convert/libreoffice/upload -o document.pdf
⁠XLSX to PDF (Report Generation)
curl -F "[email protected]" -F "format=pdf" \
     http://localhost:10996/convert/libreoffice/upload -o report.pdf
⁠PPTX to PDF (Presentation Sharing)
curl -F "[email protected]" -F "format=pdf" \
     http://localhost:10996/convert/libreoffice/upload -o slides.pdf

Built with Spring Boot 3.5.6 + GraalVM 25 + LibreOffice

One engine, endless possibilities: Universal document format conversion. ⚔

Tag summary

Content type

Image

Digest

sha256:c6c7e57ff…

Size

237.7 MB

Last updated

6 months ago

docker pull molandev/libreoffice-converter-api