wteja/pdf-converter

By wteja

Updated about 1 month ago

Easily convert office documents to PDF using a Go-based server and LibreOffice in headless mode.

Image
Web Servers
Developer Tools
0

58

The Office to PDF Converter Docker image provides a simple and efficient way to convert office file formats to PDF. It uses a Go-based HTTP server as the backend and LibreOffice in headless mode for the conversion process.

This container is ideal for developers who need a quick solution for document conversion in web applications, automation pipelines, or microservices. With built-in support for multiple file formats and endpoints for health checks and conversions, it is designed to be reliable, lightweight, and easy to use.


Features

  • Convert office documents (.docx, .xlsx, .pptx, etc.) to PDF.
  • Built-in HTTP endpoints:
    • Health Check: GET /
    • Convert: POST /convert (Upload files for conversion)
  • Automatic cleanup of temporary files after one hour.
  • Runs on port 5000 by default.
  • Publicly available at https://pdf-converter.itthirit.io.

Supported File Formats

  • Documents: .doc, .docx, .odt, .rtf, .txt
  • Spreadsheets: .xls, .xlsx, .ods, .csv
  • Presentations: .ppt, .pptx, .odp
  • Other: .svg, .html, .xml

How to Use

  1. Pull the Docker image:

    bash

    Copy code

    docker pull wteja/pdf-converter

  2. Run the container:

    bash

    Copy code

    docker run -p 5000:5000 wteja/pdf-converter

  3. Endpoints:

    • Health Check:

      bash

      Copy code

      curl http://localhost:5000/

      Response: OK

    • Convert Document:

      bash

      Copy code

      curl -X POST -F "file=@example.xlsx" http://localhost:5000/convert --output output.pdf


Use Cases

  • Integrate with web applications for document conversion.
  • Automate workflows and pipelines requiring file format conversion.
  • Microservices architecture where office-to-PDF conversion is needed.

Technical Details

  • Base Image: Ubuntu
  • Dependencies: LibreOffice, Go
  • Default Port: 5000

Support

For issues or feature requests, please contact me via the Docker Hub repository or submit an issue in the GitHub repository.

Docker Pull Command

docker pull wteja/pdf-converter